Thread: UserForm Help
View Single Post
  #2   Report Post  
Harald Staff
 
Posts: n/a
Default

Hi Jennifer

Doesn't the error message say "Expected End Sub" ? A Sub must be closed with
End Sub , and that is missing.

Private Sub UserForm_Initialize()
txtMonth.Value = Date
End Sub

Not guaranteeing that's the only error, it depends on what your objects are
and what they are supposed to do.

HTH. Best wishes Harald

"Jennifer" skrev i melding
...
:Hi,
I am writing this from an example from Debrah's web site: I am not sure

how
to test it to see if it works. When I try it says sub error?
Private Sub UserForm_Initialize()
txtMonth.Value = Date
Function StartOfMonth(InputDate)
If IsDate(InputDate) Then
StartOfMonth = DateSerial(Year(InputDate), _
Month(InputDate), 1)
Else
StartOfMonth = Empty
End If
End Function

--
Though daily learning, I LOVE EXCEL!
Jennifer