Calendar again

  • Thread starter Thread starter alvin Kuiper
  • Start date Start date
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
 
If you have a licensed Visual Studio installed then look for MS Date Time
Picker control..

If this post helps click Yes
 
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.
 
Thanks
Is there a way to format the day to dd,mm,yyyy
Alvin


"Jacob Skaria" skrev:
 
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
 
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
'/==========================================/
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top