this macro will delete column C, D, E and/or F depending on columns conten:
Public Sub test()
Dim C_ol As Range
For Each C_ol In Range("C1:F1")
If C_ol.EntireColumn.Cells.SpecialCells(xlCellTypeConstants).Count - 1 = 0 Then
Range(C_ol, Range("F1")).EntireColumn.Delete
Exit For
End If
Next
End Sub
This one will delete columns G, H, I J K L M and/or N depending on columns contents:
Public Sub test()
Dim C_ol As Range
For Each C_ol In Range("G1:N1")
If C_ol.EntireColumn.Cells.SpecialCells(xlCellTypeConstants).Count - 1 = 0 Then
Range(C_ol, Range("N1")).EntireColumn.Delete
Exit For
End If
Next
End Sub
The problem here is that when you run the first macro, the OLD column G is no longer at G because you'll have deleted some columns. So you can run either one of them but not both unless we can refer to titles to locate the columns to be deleted.
Hope this helps.
Bookmarks