View Single Post
  #1   Report Post  
sloanranger
 
Posts: n/a
Default inset rows and copy formatting , excel macro

i need a macro that inserts rows the same as the macro below but will
also copy the formatting and formula from the row above

Sub Macro1()
'-- Ken Wright, 2003-08-09
Application.ScreenUpdating = False
Dim numRows As Integer
Dim r As Long
Dim Rng As Range
Dim lastrw As Long
numRows = InputBox("How many Rows")
lastrw = Cells(Rows.Count, "A").End(xlUp).Row
Set Rng = Range(Cells(1, "A"), Cells(lastrw, "A"))
For r = Rng.Rows.Count To 1 Step -1
Rng.Rows(r + 1).Resize(numRows).EntireRow.Insert
Next r
Application.ScreenUpdating = True
End Sub