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

Leave a Reply

Your email address will not be published.Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.