Macro to Insert and Delete Columns in Excel


Insert Columns in between each column containing data


Sub InsertColumns()
Range("B1").Select
Do Until ActiveCell.Value = ""
Selection.EntireColumn.Insert
ActiveCell.Offset(0, 2).Select
Loop
End Sub

Delete Columns in between columns containing data


Sub DeleteColumns()
Range("B1").Select
Do Until ActiveCell.Offset(0, 1).Value = ""
Selection.EntireColumn.Delete
ActiveCell.Offset(0, 1).Select
Loop
End Sub

How to use codes shared here?