ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Calendar again (https://www.excelbanter.com/excel-discussion-misc-queries/230225-calendar-again.html)

alvin Kuiper

Calendar again
 
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


Jacob Skaria

Calendar again
 
VBE--Tools--Additional control--Select Calendar control...
--
If this post helps click Yes
---------------
Jacob Skaria


"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


Jacob Skaria

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

If this post helps click Yes
---------------
Jacob Skaria


"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


royUK[_12_]

Calendar again
 

Using the calendar control or datepicker can cause problems if a user
doesnot have the control installed.

See this 'example' (http://www.sendspace.com/file/edtf8c)


--
royUK

Hope that helps, RoyUK
For tips & examples visit my 'web site' (http://www.excel-it.com/)
------------------------------------------------------------------------
royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=94578


Lynz

Calendar again
 
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

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.

royUK[_13_]

Calendar again
 

Lynz;338187 Wrote:
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

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


--
royUK

Hope that helps, RoyUK
For tips & examples visit my 'web site' (http://www.excel-it.com/)
------------------------------------------------------------------------
royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=94578


alvin Kuiper

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


"Jacob Skaria" skrev:

VBE--Tools--Additional control--Select Calendar control...
--
If this post helps click Yes
---------------
Jacob Skaria


"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


Jacob Skaria

Calendar again
 
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
---------------
Jacob Skaria


"Lynz" wrote:

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

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.


Dave Peterson

Calendar again
 
Ron de Bruin has some notes:
http://www.rondebruin.nl/calendar.htm

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


--

Dave Peterson

Gary Brown[_5_]

Calendar again
 
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


Gary Brown[_5_]

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


Dave Peterson

Calendar again
 
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.

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


--

Dave Peterson


All times are GMT +1. The time now is 12:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com