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 (copy/paste range (B1:N1 the 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, and a number of different approaches but nothing is working I think the problem rests with 'ActiveCel'l but not sure.
Thanking you in advance.
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