I have a cell F2 that contains a value (lets say 6008) dictated by a combobox so it is different each time. I am using the following code:
Application.ScreenUpdating = False
For i = Range("D65000").End(xlUp).Row To 4 Step -1
If Trim(Cells(i, 4)) <> Range("F2") Then Rows(i).Delete
Next
Application.ScreenUpdating = True
I want all of the remaining rows to have 6008 somewhere in the D column.
It is deleting the rows when D? is not equal to 6008, but I don't want it to delete rows when D? equals 6008A, x6008, etc. How do I acomplish matching part of the cell (wildcard?)?
Thanks!!!
Bookmarks