Windows XP, Excel 2003
Hi,
I have a simple code that looks across the headers in row 5 of my worksheet and deletes any columns with the header "Bad" in it. What I can't figure out is how to make it also delete the adjacent column to the right.
Here is my code so far:
Any help would be appreciated. Thanks!
Hi,
I have a simple code that looks across the headers in row 5 of my worksheet and deletes any columns with the header "Bad" in it. What I can't figure out is how to make it also delete the adjacent column to the right.
Here is my code so far:
Code:
Public Sub DelBadCol()
For Each c In ThisWorkbook.Worksheets("Region").Range("5:5")
If Instr (c, "Bad") Then
c.EntireColumn.Delete
End If
Next c
End Sub
Any help would be appreciated. Thanks!