Skip to content

Instantly share code, notes, and snippets.

@harsha547
Created June 8, 2017 17:51
Show Gist options
  • Save harsha547/286696cc167553bab68cbfa7a47e47b2 to your computer and use it in GitHub Desktop.
Save harsha547/286696cc167553bab68cbfa7a47e47b2 to your computer and use it in GitHub Desktop.
Sub sbDelete_Columns_IF_Cell_Cntains_String_Text_Value()
Dim lColumn As Long
Dim iCntr As Long
lColumn = 20
For iCntr = lColumn To 1 Step -1
If Cells(1, iCntr) = “Your String” Then ‘ You can change this text
Columns(iCntr).Delete
End If
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment