I trying to come up with VBA code that will allow me to multiple select, insert blank rows, and then populate the new (blank) rows with text – (range (B1:N1) header row.
The code below will allow a single entry but I can’t come up with the VBA code to allow for a multiple select.
I’ve tried looping, autofilter, If statement, and other approaches but nothing is working I think the problem rests with 'ActiveCell' but not sure.
Code:
Sub Insert_Header()
“NOTE: First row of worksheet (“B1:N1”) is header
Application.ScreenUpdating = False
‘Insert Blank row where selected in spreadsheet
Selection.EntireRow.Insert
‘Select blank rows & copy/paste header
Range(“B:B”).SpecialCells(xlCellTypeBlanks).Select
Range(“B1:N1”).Copy ActiveCell
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub