Hi all,
I need help with inserting a variable number of columns. Heres the details:
In one sheet I have 52 columns (this will always change) of data and in another I have 50 (again this will change). In the sheet with 50 I would like to insert X number of columns so both sheets have the same number. (52)
I cannot just copy and paste as formulas I have written previously will be overwritten.
I am fairly new to writing tihs type of code but heres what I have:
Dim RawDataColCount As Integer
Sheets("Raw Data").Select
RawDataColCount = Cells.SpecialCells(xlCellTypeLastCell).Column
Sheets("Data").Select
Dim DataColCount As Integer
DataColCount = Columns("B:AY").Count
If RawDataColCount > DataColCount Then
Sheets("Data").Select
Range("B:B").Select
Selection.Insert Shift:=xlToRight
Do Until DataColCount = RawDataColCount
DataColCount = DataColCount + 1
Loop
End If
Bookmarks