我有以下代码只是删除了 excel 中的范围.. 但我不知道为什么如果您单击按钮删除选定的范围,它会发生整个范围都被删除,我不知道为什么。你能帮我提前谢谢
Private Sub cmdDel_Click()
cmdEdit.Enabled = False: cmdAdd.Enabled = False
cmdClose.Caption = "CANCEL"
If MsgBox("Delete this record?", vbYesNo + vbQuestion, "Message") = vbYes Then
Range("A" & r & ":" & "V" & r).Delete
r = 0
MsgBox "Record deleted!", vbExclamation, "Message"
End If
Call UserForm_Activate
End Sub