Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default date Calender user form


Hi,

Is it possible to create a calender drop down as a user form, thus when
then date is select via the drop down, it is set as a value in the user
form. Similar to the date calender on webpages ?


--
sam1
------------------------------------------------------------------------
sam1's Profile: http://www.excelforum.com/member.php...o&userid=18280
View this thread: http://www.excelforum.com/showthread...hreadid=514128

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default date Calender user form


There are two methods for this...

Both involve using the "event" for the control.

1) If using a calendar control (standard Excel/windows calendar), the
"click" event should be sufficient. When the user clicks on the
calendar (date button of a specific month), the value (properly
formatted) can be posted to a label or text box.

2) if using a dropdown list, populate the list with dates and then
using the "change" event, populate the label or the text box.

Examples below:

where the main userform is called "InputChildAge" and contains a label
to hold the date called "Label1"

1) using a separate calendar
Private Sub Calendar1_Click()
InputChildAge.Label1.Caption =
Format(InputChildAge.Calendar1.Value, "MMMM DD, YYYY")
End Sub

2) using a dropdown...
Private Sub ComboBox1_Change()
InputChildAge.Label1.Caption =
Format(InputChildAge.Dropdown1.Value, "MMMM DD, YYYY")
End Sub


--
weavtennis
------------------------------------------------------------------------
weavtennis's Profile: http://www.excelforum.com/member.php...fo&userid=3634
View this thread: http://www.excelforum.com/showthread...hreadid=514128

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default date Calender user form

Hi

A 3rd method (without using any VBA):

On a separate (hidden) sheet, create a list of available dates (it can be
static, or dynamic, where available dates are created depending p.e. on
current date.). Define this date list as named range (again, it can be
defined as static or dynamic range - it depends, is the length of date list
fixed, or changes). Format the list in any valid date format, you think to
be bequem for user to use when selecting the date.

Format as data validation list all cells where you want to select dates. Set
list source to be equal to created named range. Format those cells in any
valid date format (It can be different from format you used in date list).
It's al.

The user can select dates from data validation drop-down lists, or enter
them manually. And unless you declare otherwise when implementing data
validation, the user can enter only values present in date list on hidden
sheet, or clear cell values. (Especially I advice to use this method, when
you need select values in many cells.)

Arvi Laanemets


"weavtennis" wrote
in message ...

There are two methods for this...

Both involve using the "event" for the control.

1) If using a calendar control (standard Excel/windows calendar), the
"click" event should be sufficient. When the user clicks on the
calendar (date button of a specific month), the value (properly
formatted) can be posted to a label or text box.

2) if using a dropdown list, populate the list with dates and then
using the "change" event, populate the label or the text box.

Examples below:

where the main userform is called "InputChildAge" and contains a label
to hold the date called "Label1"

1) using a separate calendar
Private Sub Calendar1_Click()
InputChildAge.Label1.Caption =
Format(InputChildAge.Calendar1.Value, "MMMM DD, YYYY")
End Sub

2) using a dropdown...
Private Sub ComboBox1_Change()
InputChildAge.Label1.Caption =
Format(InputChildAge.Dropdown1.Value, "MMMM DD, YYYY")
End Sub


--
weavtennis
------------------------------------------------------------------------
weavtennis's Profile:

http://www.excelforum.com/member.php...fo&userid=3634
View this thread: http://www.excelforum.com/showthread...hreadid=514128



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with date in user form Ivo_69 New Users to Excel 3 June 24th 09 02:35 PM
Date format changes when inputed from user form Lynz Excel Discussion (Misc queries) 16 December 13th 08 11:27 PM
visual basic user form date format dd/mm/yy not mm/dd/yy DarrenO Excel Discussion (Misc queries) 1 March 28th 07 01:56 AM
user form text box date problems Francis Brown Excel Programming 5 October 20th 05 02:39 PM
Date formatting issue in user form Jennifer Excel Programming 3 April 16th 05 09:49 AM


All times are GMT +1. The time now is 09:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"