I have a large workbook with multiple columns. In row 9 I have labels that are either 'REMOVE', 'CHECK' or 'INSTALL'. I'm trying to write a macro that deletes all columns with 'remove'. The number of remove columns varies every time.
I've adapted this macro from something I found online, it sort-of works but seems to only delete every other remove column. Could someone tell me where I'm going wrong?
I've adapted this macro from something I found online, it sort-of works but seems to only delete every other remove column. Could someone tell me where I'm going wrong?
Rich (BB code):
Sub Delete_Column()
Dim cell As Range
For Each cell In Range("9:9")
If cell.Value = "REMOVE" Then
cell.EntireColumn.Delete
End If
Next cell
End Sub