Delete rows in workbook 2 based on values in a column in workbook 1

  • Hi guys,


    I hope you're well and safe. I am trying to create a macro to delete line items in another workbook but i am a total novice. After hours of research I am still struggling badly to the point where i feel useless. I was sincerely hoping some good people on this forum could help save me from throwing my laptop out of the window. ||


    What i am trying to achieve;


    Workbook 1 (2 x sheets)

    • Sheet 1 - has a cell where the user inputs the file name of Workbook 2 which is to have line items deleted from it e.g. "Workbook 2 22-04-2021" which will be closed. Also has a button to run the macro.
    • Sheet 2 - contains data in many columns but column A will be the deciding factor of which rows should be deleted in Workbook 2 - Sheet 1.


    Workbook 2 (1x sheet)

    - contains the data and the line items which are to be deleted if present in Workbook 1, Sheet 2.


    Any help from the geniuses on here would be much appreciated and i would be forever grateful! X


    Cheers,


    Luke

  • Could you attach a copy of your two files? It would be easier to see how your data is organized and to test possible solutions. Include a detailed explanation of what you want to do using a few examples from your data and referring to specific cells, rows, columns and sheets. De-sensitize the data if necessary.

    You can say "THANK YOU" for help received by clicking the :thumbup: icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Hi Mumps, hope you're having a good evening and thank you very much for the response. :) apologies for the late reply, i had some trouble with my connection. I have managed to get on and have attached the desensitised workbooks. I have included some information in there to reflect what i am trying to achieve. hopefully it makes sense but i can answer any queries if not! Thank you for offering to help, it means a lot. :thumbup:

  • Try:

    You can say "THANK YOU" for help received by clicking the :thumbup: icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Hi Mumps, i just took it for a spin and it works! I am eternally grateful. :)


    I have noticed that i must keep the workbook item that is having the line items removed from it open whilst i run the macro but this is not a problem.


    Thanks so much.


    Luke :thumbup:

  • You are very welcome. :)

    You can say "THANK YOU" for help received by clicking the :thumbup: icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.