我有以下代码,它曾经工作过但不再有用。这是用户形式:
Private Sub First_Name_Nom_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Call RunFast_Begin
Sheets("TEST_Nominator").Select
If Sheets("TEST_Nominator").Range("C3").Value = "Nominator's First Name" Then
[C3].Value = ""
ElseIf Sheets("TEST_Nominator").Range("C3").Value = "" Then
[C3].Value = "Nominator's First Name"
End If
Call RunFast_End
End Sub
Private Sub First_Name_Nom_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Call RunFast_Begin
Sheets("TEST_Nominator").Select
If Sheets("TEST_Nominator").Range("C3").Value = "Nominator's First Name" Then
[C3].Value = ""
ElseIf Sheets("TEST_Nominator").Range("C3").Value = "" Then
[C3].Value = "Nominator's First Name"
End If
Call RunFast_End
End Sub
Private Sub First_Name_Nom_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Call RunFast_Begin
Sheets("TEST_Nominator").Select
If Sheets("TEST_Nominator").Range("C3").Value = "Nominator's First Name" Then
[C3].Value = ""
ElseIf Sheets("TEST_Nominator").Range("C3").Value = "" Then
[C3].Value = "Nominator's First Name"
ElseIf Range("C3").Value <> "Nominator's First Name" Then
End If
Call RunFast_End
End Sub
这是运行快速结束和结束的代码
Public CalcState As Long
Public EventState As Boolean
Public PageBreakState As Boolean
Sub RunFast_Begin()
Application.ScreenUpdating = False
EventState = Application.EnableEvents
Application.EnableEvents = False
'CalcState = Application.Calculation
'Application.Calculation = xlCalculationManual
PageBreakState = ActiveSheet.DisplayPageBreaks
ActiveSheet.DisplayPageBreaks = False
'addition pour ce program
Sheets("List").Visible = True
Sheets("Prov").Visible = True
Sheets("Test").Visible = True
Sheets("Teste").Visible = True
Sheets("TEST_Nominator").Visible = True
Sheets("Nominees").Visible = True
Sheets("Nomes(es)").Visible = True
End Sub
Sub RunFast_End()
ActiveSheet.DisplayPageBreaks = PageBreakState
'Application.Calculation = CalcState
Application.EnableEvents = EventState
Application.ScreenUpdating = True
'addition pour ce program
Sheets("List").Visible = False
Sheets("Prov").Visible = False
Sheets("Test").Visible = False
Sheets("Teste").Visible = False
Sheets("TEST_Nominator").Visible = False
Sheets("Nominees").Visible = False
Sheets("Nomes(es)").Visible = False
End Sub
因此技术上需要做的是,当有人点击或双击userform的First_Name_Nom文本框时,写入的信息会消失,让用户写下第一个名字。我理解的是一个额外的,因为从技术上来说,它永远不应该是空白,但这只是一个预防措施。
有人可以告诉我为什么Nominator的名字不会因用户的点击或双击而消失吗?
感谢您的帮助