Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I run a macro in the background whilst a UserForm is visib | Excel Discussion (Misc queries) | |||
UserForm TextBox/ComboBox question | Excel Discussion (Misc queries) | |||
Vlookup in a userform | Excel Discussion (Misc queries) | |||
userform textbox | Excel Worksheet Functions | |||
Userform | Excel Worksheet Functions |