Greetings, I have some code that would like to tweak and have it perform better.
Previously a VLookup has identified which columns to keep.
Then I delete all the others with the macro. There are 60 columns in all.
Not sure what I can do.
Thanks
Eric
Previously a VLookup has identified which columns to keep.
Then I delete all the others with the macro. There are 60 columns in all.
Not sure what I can do.
Code:
Sub Listonly()
Dim i As Long, LC As Long
Dim hdr As String
LC = Range("IV1").End(xlToLeft).Column
For i = LC To 1 Step -1
hdr = Cells(1, i)
If InStr(hdr, "Keep") = 0 Then
Columns(i).Delete
End If
Next i
End Sub
Thanks
Eric