Hi there,
I've seen various pieces of code which are aimed at deleting rows if certain text does or does not appear, e.g -
However I can't seem to manipulate this to work for columns. All I want to do is check row 3 all the way across my sheet and delete any columns which don't contain the words "dog" or "cat".
Hopefully this is a simple one to work out for you as I just cannot get it to work.
Thanks.
I've seen various pieces of code which are aimed at deleting rows if certain text does or does not appear, e.g -
Code:
Sub RemoveRows()Dim LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = LR To 2 Step -1
If Not Range("A" & i).Value Like "Subtotal*" Then Rows(i).Delete
Next i
End Sub
However I can't seem to manipulate this to work for columns. All I want to do is check row 3 all the way across my sheet and delete any columns which don't contain the words "dog" or "cat".
Hopefully this is a simple one to work out for you as I just cannot get it to work.
Thanks.