1
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.

Toddleson
  • 4,321
  • 1
  • 6
  • 26

1 Answers1

1

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
Toddleson
  • 4,321
  • 1
  • 6
  • 26