How to delete multiple columns in Excel VBA? I tried:
Sub DelColumns()
Dim col As Range
For Each col In Range("A:C,E:E,H:S,U:AK,AM:AM,AO:AU,BC:BI,BK:BV").Columns
col.EntireColumn.Delete
Next col
End Sub
Update. I try to do it on a table which is a show-detail table of pivot table. Is it possible to delete table columns without converting the table to a range first?
Range("A:C,E:E,H:S,U:AK,AM:AM,AO:AU,BC:BI,BK:BV").DeleteRun time error 1004Delete method of range class failed