vendredi 4 septembre 2015

Object required error from If syntax?

The below syntax:

Private Sub UserForm_Activate()
If Hour(Now) < 7 Then MonthView1.Value = Date - 1
If Hour(Now) >= 7 Then MonthView1.Value = Date
WorksOrder.SetFocus
End Sub

generates the error: Object required Highlighting the "MonthView1.Value = Date" from the 3rd line

Can anyone see the issue please? Using Excel 2007

Aucun commentaire:

Enregistrer un commentaire