Calendar again

A

alvin Kuiper

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
 
J

Jacob Skaria

If you have a licensed Visual Studio installed then look for MS Date Time
Picker control..

If this post helps click Yes
 
L

Lynz

alvin said:
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
You can use a calendar in a user form. I have one in one of mine. Sorry
I cant remember where I got it from but if I dblclick a text box on the
user form a calendar pops up and I can insert a date which is then
inserted into my spread sheet. By the way the calendar is another
UserForm. Maybe if you do a search for userform calendar you will find
one. sorry not much help.
 
R

royUK

Lynz;338187 said:
You can use a calendar in a user form. I have one in one of mine.
Sorry
I cant remember where I got it from but if I dblclick a text box on
the
user form a calendar pops up and I can insert a date which is then
inserted into my spread sheet. By the way the calendar is another
UserForm. Maybe if you do a search for userform calendar you will find
one. sorry not much help.

The example I linked to in my first post does this
 
A

alvin Kuiper

Thanks
Is there a way to format the day to dd,mm,yyyy
Alvin


"Jacob Skaria" skrev:
 
J

Jacob Skaria

Which control are you using.

Once you get the value to a variable; say dtValue

Msgbox Format(dtValue,"dd,mm,yyyy")


If this post helps click Yes
 
G

Gary Brown

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
'/==========================================/
 
G

Gary Brown

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
 
D

Dave Peterson

I'm not quite sure why you'd want to store and retrieve something from the
windows registry for getting a date from the user.

And I'd use a Label, not a textbox. I'd want all the changes to that date to
come from the calendar control.
 
Top