I am looking to use a active x command button, when clicked, it will ask user how many rows they want to insert. I then want it to insert rows, and add row highlights. I also want column g to be change to formula. Here is the code I have so far. I am getting an error. Can someone help?
Private Sub CommandButton1_Click()
Dim numrow
numrow = Application.InputBox("How many rows would you like to add?", "Insert Row", , , , , , 1)
If IsNumeric(numrow) Then
For i = 1 To numrow
Call INR
Next i
End If
End Sub
and
Sub INR()
Sheets("Assessment").Range("A" & Rows.Count).End(x1Up).Select
ActiveCell.EntireRow.Insert Shift:=xlDown
Sheets("Assessment").Range("$A":"$L").Select
Selection.Borders.Weight = xlThin
Sheets("Assessment").Range("G4").Select
ActiveCell.Formula = "=IF(ISBLANK($F4),"", CONCATENATE(Priority & $L4 & , & $F4))"
End Sub
Private Sub CommandButton1_Click()
Dim numrow
numrow = Application.InputBox("How many rows would you like to add?", "Insert Row", , , , , , 1)
If IsNumeric(numrow) Then
For i = 1 To numrow
Call INR
Next i
End If
End Sub
and
Sub INR()
Sheets("Assessment").Range("A" & Rows.Count).End(x1Up).Select
ActiveCell.EntireRow.Insert Shift:=xlDown
Sheets("Assessment").Range("$A":"$L").Select
Selection.Borders.Weight = xlThin
Sheets("Assessment").Range("G4").Select
ActiveCell.Formula = "=IF(ISBLANK($F4),"", CONCATENATE(Priority & $L4 & , & $F4))"
End Sub