Sub Delete_Specific_Columns()
Dim sh As Worksheet
Set sh = ActiveSheet
sh.Columns("B:D,I:AZ,BC:BJ,BO:EQ").Delete
End Sub
Keep getting a type mismatch error.
The Columns
property doesn't accept multiple column addresses (like B:D) or using commas to join multiple areas, it only accepts a single number or column letter name (like "D" or "BC"). If you want to use a complex address, use the Range
property instead:
Sub Delete_Specific_Columns()
Dim sh As Worksheet
Set sh = ActiveSheet
sh.Range("B:D,I:AZ,BC:BJ,BO:EQ").Delete Shift:=xlShiftToLeft
End Sub