This code
The code for the macro RunNewsetMSG is
When I run this I get a “Subscript out of range at this line in the RunNewMSG macro:
What I want is to display the DATETIME userform with each UNIQUE VALUE in textbox1 read from the For i = loop every 10 seconds. What subscript is out of range ? What’s wrong with this ? Thx for any help. cr
Code:
Private Sub cmdFindDate_Click()
Dim i, n As Integer
Dim t
For i = 2 To [A65536].End(xlUp).Row
n = Day(Cells(i, 1).Value)
If n = Day(Now()) Then
t = Now() + TimeSerial(0, 0, 10)
Application.OnTime t, "RunNewSetMSG"
Else
MsgBox "value does not match"
End If
Next
Exit Sub
End Sub
The code for the macro RunNewsetMSG is
Code:
Sub RunNewSetMSG()
DATETIME.TextBox1.Value = Sheets("DATAEND").Range.Cells(i, 4).Value
DATETIME.Show
End Sub
When I run this I get a “Subscript out of range at this line in the RunNewMSG macro:
Code:
DATETIME.TextBox1.Value = Sheets("DATAEND").Range.Cells(1, 4).Value