#1   Report Post  
Jennifer
 
Posts: n/a
Default UserForm Help

: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
  #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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I run a macro in the background whilst a UserForm is visib cdb Excel Discussion (Misc queries) 3 February 10th 05 06:58 PM
UserForm TextBox/ComboBox question grasping@straws Excel Discussion (Misc queries) 1 February 2nd 05 11:14 AM
Vlookup in a userform R D S Excel Discussion (Misc queries) 6 January 26th 05 09:22 PM
userform textbox Phil Excel Worksheet Functions 5 January 16th 05 06:59 PM
Userform Phil Excel Worksheet Functions 1 January 13th 05 06:36 PM


All times are GMT +1. The time now is 09:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"