I am trying to make buttons at various places within my worksheet to do the same thing (add rows). When I write the first macro for the button it works like a charm but when I copy it to the second button I get errors. The only thing that should change is where the blank row is inserted. Can anyone help me out with the macro below?
Private Sub CommandButton1_Click()
' Range("$A$2:$L$2").Select
Selection.Copy
Set c = Cells.Find("Daily Briefing Topic", , , xlWhole)
With c.EntireRow
.Copy
.Insert
Application.CutCopyMode = False
Intersect(.Offset(-1), Range("A:L")).ClearContents
End With
End Sub
Private Sub CommandButton2_Click()
' Range("$A$2:$L$2").Select
Selection.Copy
Set c = Cells.Find("Evening Briefing Topic", , , xlWhole)
With c.EntireRow
.Copy
.Insert
Application.CutCopyMode = False
Intersect(.Offset(-1), Range("A:L")).ClearContents
End With
End Sub
Private Sub CommandButton1_Click()
' Range("$A$2:$L$2").Select
Selection.Copy
Set c = Cells.Find("Daily Briefing Topic", , , xlWhole)
With c.EntireRow
.Copy
.Insert
Application.CutCopyMode = False
Intersect(.Offset(-1), Range("A:L")).ClearContents
End With
End Sub
Private Sub CommandButton2_Click()
' Range("$A$2:$L$2").Select
Selection.Copy
Set c = Cells.Find("Evening Briefing Topic", , , xlWhole)
With c.EntireRow
.Copy
.Insert
Application.CutCopyMode = False
Intersect(.Offset(-1), Range("A:L")).ClearContents
End With
End Sub