Msg Box

  • Thread starter Thread starter David
  • Start date Start date
D

David

Hi,

The macro below is attached to a command button that when
clicked copies the row and formulas down from the row
above. I am finding that I need to insert multiple rows
and copy those formulas...Can someone please help me
modify the code so that maybe a msgbox will pop up and ask
me how many rows to insert?

Thanx much

Sub insertrowswithformulas()
With ActiveCell
..EntireRow.Insert
Range(Cells(.Row - 2, "I"), Cells(.Row - 2, "AL")).Copy _
Cells(.Row - 1, "I")
Range(Cells(.Row - 2, "B"), Cells(.Row - 2, "G")).Copy _
Cells(.Row - 1, "B")
End With
End Sub
 
This message would be better posted in the programming forum, however, to
get you started,

dim r as integer
r = InputBox("Enter number of rows to add")


This would capture the number of rows as r which can be used in other parts
of your code.

-John
www.JohnMichl.com
 
Back
Top