Hi,
I have three command buttons and I want to redo the code to combine them into one.
Is it possible?
Help is appreciated.
Commandbutton2
Private Sub CommandButton2_Click()
Sheets("CA Record").UnProtect "abcd"
With Sheets("CA Record").Range("A1").CurrentRegion
If .Rows.Count > 1 Then
.Offset(1).Copy
Sheets("CA Record").Range("J" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValuesAndNumberFormats
.Offset(1).ClearContents
End If
Sheets("CA Record").Protect "abcd"
End With
End Sub
commandButton 3
Private Sub CommandButton3_Click()
Sheets("WCMR").UnProtect "abcd"
With Sheets("WCMR").Range("A1").CurrentRegion
If .Rows.Count > 1 Then
.Offset(1).Copy
Sheets("WCMR").Range("N" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValuesAndNumberFormats
.Offset(1).ClearContents
End If
Sheets("WCMR").Protect "abcd"
End With
End Sub
Commandbutton 4
Private Sub CommandButton4_Click()
Sheets("DBR").UnProtect "abcd"
With Sheets("DBR").Range("A1").CurrentRegion
If .Rows.Count > 1 Then
.Offset(1).Copy
Sheets("DBR").Range("H" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValuesAndNumberFormats
.Offset(1).ClearContents
End If
Sheets("DBR").Protect "abcd"
End With
End Sub
Regards
Bookmarks