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


Hi guys,

Is it possible to set up a windows calender control
attached to a excel cell ? to enable user select a
particular date ?

Thanks

Michael
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Calender Control VB

Try this Michael

Do Insert-Object from the menubar and place a calendar control on your
sheet.
It is possible you don't see it in the list, it is installed with Access.
So if you don't see it you possible don't have the control


Here a example how to use it

Place this in a Sheetmodule
If you select a cell in Column A the calendar will popup and when
you DblClick on the calendar the date will be placed in the activecell

Private Sub Calendar1_DblClick()
ActiveCell.NumberFormat = "m/d/yyyy"
ActiveCell = Calendar1
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
Else: Calendar1.Visible = False
End If
End Sub


Example for one cell

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$1" Then
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
Else: Calendar1.Visible = False
End If
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Michael" wrote in message ...

Hi guys,

Is it possible to set up a windows calender control
attached to a excel cell ? to enable user select a
particular date ?

Thanks

Michael



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
Calender Control WLMPilot Excel Discussion (Misc queries) 3 March 15th 08 04:06 PM
How to use Calender control as date chooser in excel?? Rakesh Excel Discussion (Misc queries) 2 May 25th 06 04:33 PM
how to edit calender control in excel? edit calender in excel Excel Discussion (Misc queries) 0 March 31st 06 05:42 AM
Today variable to calender control anonymous Excel Discussion (Misc queries) 2 March 10th 05 03:22 PM
Microsoft Calender Control 11.0 akim612 Excel Discussion (Misc queries) 1 January 19th 05 09:24 PM


All times are GMT +1. The time now is 11:50 PM.

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"