ADD LINES

  • Thread starter Thread starter Fernando Duran
  • Start date Start date
F

Fernando Duran

I want to add some lines, but I also, I want to have the ability to
copy down the formulas.
I started with this
Sub addlines()
Dim ans as integer
Dim x as integer
ans=inputbox("Enter the number of lines to be add")
Do until x = ans
selection.entirerow.insert
x=x+1
Loop
End Sub

Thanks
 
Sub addlines()
Dim ans As Integer
Dim x As Integer
Set rng = Selection.EntireRow.Offset(-1, 0)
ans = InputBox("Enter the number of lines to be add")
Do Until x = ans
Selection.EntireRow.Insert
x = x + 1
Loop
rng.Copy Destination:=rng.Offset(1, 0).Resize(ans)
End Sub

would be a start.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top