ankitsondhi
New Member
- Joined
- Mar 30, 2013
- Messages
- 2
Hi:
I'm using this VBA code:
Sub InsertRow()
Dim Rng, n As Long, k As Long
Application.ScreenUpdating = False
Rng = InputBox("Enter number of rows required.")
If Rng = "" Then Exit Sub
Range(ActiveCell, ActiveCell.Offset(Val(Rng) - 1, 0)).EntireRow.Insert
'need To know how many formulas To copy down.
'Assumesfrom A over To last entry In row.
k = ActiveCell.Offset(-1, 0).Row
n = Cells(k, 256).End(xlToLeft).Column
Range(Cells(k, 1), Cells(k + Val(Rng), n)).FillDown
End Sub
Everytime I have to selct the row and then enter " number of rows". Is there anyway that I dont have to select the rows and it copys a row above. My current data is on row 6.
What I want is if I run the macro, it copies to row 7, and so on.
Please help me.
I'm using this VBA code:
Sub InsertRow()
Dim Rng, n As Long, k As Long
Application.ScreenUpdating = False
Rng = InputBox("Enter number of rows required.")
If Rng = "" Then Exit Sub
Range(ActiveCell, ActiveCell.Offset(Val(Rng) - 1, 0)).EntireRow.Insert
'need To know how many formulas To copy down.
'Assumesfrom A over To last entry In row.
k = ActiveCell.Offset(-1, 0).Row
n = Cells(k, 256).End(xlToLeft).Column
Range(Cells(k, 1), Cells(k + Val(Rng), n)).FillDown
End Sub
Everytime I have to selct the row and then enter " number of rows". Is there anyway that I dont have to select the rows and it copys a row above. My current data is on row 6.
What I want is if I run the macro, it copies to row 7, and so on.
Please help me.