I have this macro below which might not be the fastest but seems to work pretty well. I need some help on having it pick up value criteria from a table rather than manually inputting it as I have currently 20 that I need to search for and delete and might have some more so ideally something where it can pick up a larger list and then search for true values within the list that would be ideal. Currently I have the list of values I want to search for to delete rows that include that value, they are on K16 to K35 but I might expand the list so if its possible to do up to for e.g. K40 and search for true values in the list that would be ideal.
I also have the list on a different sheet caller Drivers and the dataset I want to remove values from is called Import Data, I want to be able to run the macro from the Drivers page from a button so I also need a line adding to do the search on the Import Data page rather than the active sheet.
Can someone thing of an easy solution for this either adding in a couple of lines or if its easier then doing the macro a different way?
Thanks in advance.
Dim x As Long, lastrow As Long
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For x = lastrow To 1 Step -1
If Cells(x, 6).Value = "XXXX" Then