In a Excel Macro, I want to achieve this: In 'A' column there can be data in a number of rows. When user selects any Cell in 'A' col, and clicks a button, then 6 rows get inserted below selected row and data from the selected cell gets copied over to those 6 rows. I recorded a macro, and here is what I have:
Sub MacroTest()
'
' MacroTest Macro
'
Rows("5:5").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A4").Select
Selection.AutoFill Destination:=Range("A4:A10"), Type:=xlFillDefault
End Sub
What I would like to know is how to replace A4 with Active cell, and the range A4:A10 and Active cell address + 6. Please advise!