Thread: Calendar again
View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.misc
Gary Brown[_5_] Gary Brown[_5_] is offline
external usenet poster
 
Posts: 236
Default Calendar again

Forgot to say..
Name the Calendar control 'AXCalendar'
--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Gary Brown" wrote:

Everyone has their own style of using calendars.
What I do: To activate a calendar, click on a textbox, double-click a date
and have that date put into the textbox...

1) Create a user Form and name it UfCalendar.

2) Put the following code in the form
'/==========================================/
Private Sub UserForm_Activate()
AXCalendar.Value = Now()
End Sub
'/==========================================/
Private Sub AXCalendar_DblClick()
'put selected date into registry
SaveSetting AppName:="ActiveXCalendar", _
section:="Date", Key:="Value", _
setting:=AXCalendar.Value
Unload UFCalendar
End Sub
'/==========================================/

3) In the 'MouseDown' method of a textbox called TextBox1, put the following
code...
'/==========================================/
Private Sub TextBox1_MouseDown(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, _
ByVal Y As Single)
'show calendar
UFCalendar.Show
'get date from registry and put in textbox
Me.TextBox1.Value = GetSetting(AppName:="ActiveXCalendar", _
section:="Date", Key:="Value")
End Sub
'/==========================================/

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"alvin Kuiper" wrote:

Hi
I know i can use a calendar in a sheet
but can i use a calendar in a userform ?
Maybe by a little icon (image) and when clik
a form with a calendar pops up?

Alvin