'this should do it
Sub AddRows()
On Error GoTo etrap
'number of rows
Dim MyNum
MyNum = InputBox("How many rows do you want to add?")
'data validation
If MyNum = "" Then
MsgBox "Integer required"
Exit Sub
ElseIf IsNumeric(MyNum) = False Then
MsgBox "Integer required"
Exit Sub
End If
'insert rows
Dim i
For i = 1 To MyNum
Range("A2").Select
Selection.EntireRow.Insert
Next i
Exit Sub
'catch errors
etrap:
MsgBox "should never get here"
end sub
Faster-
I really appreciate the help. Only problem is I am completely ignorant of Macros. Do i copy this and put into a command button? If I do then where do I enter the number of Rows I would like to have added. Thanks a lot.
-Greg
Go into the Visual Basic editor
Select Tools/Macro/Visual Basic Editor
Inside the editor select
Insert/Module
Paste the code in the module.
Back in Excel:
You can run the code by selecting Tools/Macro/Macros
this will display macros available. You can assign
a hot-key in this section.
or
you can customize your toolbar by adding a button
and assigning the macro to it.
It may appear complex, but it is pretty easy.
You should take some time to look around in the editor
when you can.
NEVERMIND that last one; i kinda figured it out. 2 little questions though....
First of all thanks,
its working almost perfectly. Only problem is that on the macro it creates lines that are too high (height 21.00 instead of 12.75) and I would like the bottom line to have a double bar border. Is this stuff even possible. hanks for all of your help already and thanks for looking at all this stuff I have to do. I really appreciate it.
-Greg