|
こんにちは。
0.5秒ってのはSleep(API)使うと思うんですけど、よく解らなかったんで1秒間隔にしました。こんな感じでどうでしょうか?
Private Sub UserForm_Activate()
DoEvents
SendKeys "111"
DoEvents
TextBox2.SetFocus
Application.Wait Now + TimeValue("00:00:01")
SendKeys "111"
DoEvents
TextBox3.SetFocus
Application.Wait Now + TimeValue("00:00:01")
SendKeys "111"
DoEvents
TextBox4.SetFocus
Application.Wait Now + TimeValue("00:00:01")
SendKeys "111"
DoEvents
End Sub
Private Sub UserForm_Initialize()
TextBox1.SetFocus
End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox1.Value = "" Then
Cancel = True
Else
Cancel = False
End If
End Sub
Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox2.Value = "" Then
Cancel = True
Else
Cancel = False
End If
End Sub
Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox3.Value = "" Then
Cancel = True
Else
Cancel = False
End If
End Sub
Private Sub TextBox4_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox4.Value = "" Then
Cancel = True
Else
Cancel = False
End If
End Sub
|
|