View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Sending a parameter to a Userform

Hi Dave,

One way:

In a standard module, before any procedures, insert:

Public myDate As Date


Again in a standard module:
'=============
Public Sub Tester()
myDate = CDate("21/10/05")
UserForm1.Show
End Sub
'<<=============

In the Userform module:
'=============
Private Sub UserForm_Initialize()
Me.Calendar1.Value = myDate
Me.CommandButton1.Default = True
End Sub
'<<=============


---
Regards,
Norman


"Dave Scott" wrote in message
...
Is there a way to pass a parameter to a Userform (similar to openargs in
an
access form)?

I have a calendar (Userform) that returns a date. I want the calendar to
be
initialized with the parameter date or with today's date if the parameter
value is empty.

Dave
--
newbie AND < expert