首先考虑使用常规 Cell 而不是 Checkbox(更简单更好)然后尝试下面的代码:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim checkedMark As String
Dim currentRow As Integer, lastRow As Integer
checkedMark = "X"
If Target.Rows.Count <> 1 Then
Exit Sub
End If
If TypeName(Target.Value) <> "String()" Then
Exit Sub
End If
If UCase(Target.Value) <> checkedMark Then
Exit Sub
End If
If Target.Columns <> 7 Then
Exit Sub
End If
currentRow = Target.Row
Range(Cells(currentRow, 1), Cells(currentRow, 7)).Copy
With Sheets(BD_SHEET)
lastRow = .Range("A100000").End(xlUp).Row
Cells(lastRow + 1, 1).PasteSpecial xlPasteValues
End With
With Cells(currentRow, 1).Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 5296274
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub