Попробуйте следующее. Это проверит, содержит ли текстовое поле два символа и содержит ли оно числовое значение. Затем он установит фокус на второе текстовое поле
Private Sub TextBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If Not (KeyCode = vbKeyBack Or KeyCode = vbKeyDelete Or (47 < KeyCode And KeyCode < 58) Or (95 < KeyCode And KeyCode < 106)) Then
If Len(Me.TextBox1.Value) = 1 Then
Me.TextBox1.Value = ""
Else
Me.TextBox1.Value = Left(Me.TextBox1.Value, 1)
End If
End If
If Len(Me.TextBox1) = 2 And IsNumeric(Me.TextBox1) Then
Me.TextBox2.SetFocus
End If
End Sub
Зацикливание диапазона дат можно сделать следующим образом
Sub loopthroughdates()
Dim d As Date
For d = DateSerial(Year(Now), Month(Now), Day(Now)) To DateSerial(2020, 1, 1)
'Do stuff
Next d
End Sub