I'm new to this forum and new to Excel Macros/VBA and am totally frustrated. 
In my Excel spreadsheet I want to have a button for other users to click that will (1) add a new row in a specific location (right now the code I have will add a new row anywhere the user clicks), (2) copy the formulas (but not the data that has been entered), (3) copy the formatting and (4) number the items in the far left column increasing by 1 each time a new row is added.
I can find various vba for inserting a new row (but not in a specified spot), I can find how to add numbers by 1 in rows and I have found vba code for copying formatting. But not all in one code so that the 1 action of clicking the button will perform these 4 functions.
Any help would be so greatly appreciated. Thanks.
The code for adding the new row that I have (but will insert it where ever the user has clicked) is:
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
However, I found this formula in this forum, but it copies the data the user may have input:
Sub InsertRow(NumRow As Long)
Dim RowStr As String
RowStr = CStr(Selection.Row) & ":" & NumRow + Selection.Row - 1
Selection.EntireRow.Copy
Rows(RowStr).Insert Shift:=xlDown
Application.CutCopyMode = False
End Sub
Bookmarks