|
本帖最后由 深秋红叶2019 于 2020-3-10 15:24 编辑
这段代码哪里有问题吗,请老师帮忙改正,谢谢
Private Sub CommandButton10_Click() '删除记录
If Len(店名) = 0 Then
MsgBox "内容为空,删除学员信息失败!!!", 16, "温馨提示……": Exit Sub
End If
If MsgBox("是否真的要删除该学员信息?", vbQuestion + vbYesNo, "删除学员") = vbYes Then
Dim j
Application.ScreenUpdating = False
For j = Cells(Rows.Count, 2).End(3).Row To 7 Step -1
If Cells(j, 2) & "" = 学员电话.Text Then
If Val(学员电话.Text) = Val(Cells(j, 1)) And Val(姓名.Text) = Val(Cells(j, 2)) And (性别.Text) = (Cells(j, 3)) And (区域.Text) = (Cells(j, 4)) And Val(店名.Text) = Val(Cells(j, 5)) And (卡项名称.Text) = (Cells(j, 6)) And Val(卡号.Text) = Val(Cells(j, 7)) And Val(老板电话.Text) = Val(Cells(j, 8)) And Val(激活日期.Text) = Val(Cells(j, 9)) And Val(到期日期.Text) = Val(Cells(j, 10)) Then
Rows(j).Delete
End If
End If
Next j
Application.ScreenUpdating = True
学员电话.Text = ""
姓名.Text = ""
性别.Text = ""
区域.Text = ""
店名.Text = ""
卡项名称.Text = ""
卡号.Text = ""
老板电话.Text = ""
激活日期.Text = ""
到期日期.Text = ""
MsgBox "删除学员成功!!!", 48, "温馨提示……"
End If
'学员电话.Text = ""
'姓名.Text = ""
'性别.Text = ""
'区域.Text = ""
'店名.Text = ""
'卡项名称.Text = ""
'卡号.Text = ""
'老板电话.Text = ""
'激活日期.Text = ""
'到期日期.Text = ""
End Sub
|
|