VBA Code:
Sub test7778() 'Good but using Somewhere else'
Dim lastRow, y, x As Long
lastRow = ActiveSheet.Range("F" & Rows.count).End(xlUp).Row
For y = lastRow To 1 Step -1 'use 1 if data starts on row 1, use 2 if you have headers in row 1 with data on row 2.
If InStr(Range("F" & y), "Trim") = 0 And Range("F" & y) <> "" Then
Range("F" & y).EntireRow.Delete
End If
Next y
End Sub
HI everytime i have to run this code above i have to change below. Now it says "Trim" if i have to change it to "Money" i have to go into code all the time to do so and i do this alot.
I need it updated so when i am on the sheet. I can just type in column K2 the name then run the macro. Instead of me always opening code and changing it. Can anyone help me with this thanks.
VBA Code:
If InStr(Range("F" & y), "Trim") = 0 And Range("F" & y) <> "" Then