Forum Discussion
dta255
Jul 02, 2019Copper Contributor
Inserting New Columns of Empty Space between Pre-existing Columns
Hello,
I have an excel spreadsheet with about 50 columns and I want to insert new columns of empty space around every 5 columns (5th, 10th, 15th...). How would I go about doing that?
- BerndvbatankerIron Contributor
Hi,
you can do it with the follwing macro:
Sub InsertColumns()
Dim lngCol As Long
Dim lngColMax As Long
With ActiveSheet
lngColMax = 51
For lngCol = lngColMax To 1 Step -5
.Columns(lngCol).Insert
Next lngCol
End With
End SubBest regards Bernd
the vba-tanker - a database full of macros