Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Calender Help
Hi Please can someone help me, i am designing an Excel worksheet to hold dates and calculate days, i have two fields one for "start date" and one for "end date" what i would like to know is, is it possible when a cell is clicked under "start Date" a little calender pops up a date is chosen and is displayed in the selected cell. If it is possible please can someone help me. Many thanks -- Alexanderj ------------------------------------------------------------------------ Alexanderj's Profile: http://www.excelforum.com/member.php...o&userid=28704 View this thread: http://www.excelforum.com/showthread...hreadid=483870 |
#2
|
|||
|
|||
Calender Help
This will require some VBA
two links where I learnt it from http://www.rondebruin.nl/calendar.htm http://www.fontstuff.com/vba/vbatut07.htm hth RES |
#3
|
|||
|
|||
Calender Help
http://www.rondebruin.nl/calendar.htm
-- Regards, Peo Sjoblom "Alexanderj" wrote in message ... Hi Please can someone help me, i am designing an Excel worksheet to hold dates and calculate days, i have two fields one for "start date" and one for "end date" what i would like to know is, is it possible when a cell is clicked under "start Date" a little calender pops up a date is chosen and is displayed in the selected cell. If it is possible please can someone help me. Many thanks -- Alexanderj ------------------------------------------------------------------------ Alexanderj's Profile: http://www.excelforum.com/member.php...o&userid=28704 View this thread: http://www.excelforum.com/showthread...hreadid=483870 |
#4
|
|||
|
|||
Calender Help
Alexanderj Wrote: Hi Please can someone help me, i am designing an Excel worksheet to hold dates and calculate days, i have two fields one for "start date" and one for "end date" what i would like to know is, is it possible when a cell is clicked under "start Date" a little calender pops up a date is chosen and is displayed in the selected cell. If it is possible please can someone help me. Many thanks Try this:Private Sub Calendar1_Click() ActiveCell.Value = CDbl(Calendar1.Value) ActiveCell.NumberFormat = "dd-mmm" 'adjust this date format to meet your needs ActiveCell.Select End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Cells.Count 1 Then Exit Sub If Not Application.Intersect(Range("A1"), Target) Is Nothing Then Calendar1.Left = Target.Left + Target.Width - Calendar1.Width Calendar1.Top = Target.Top + Target.Height Calendar1.Visible = True ' select Today's date in the Calendar Calendar1.Value = Date Else: Calendar1.Visible = False End If End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. Adjust the 'Range("A1") line to meet your needs. NOTE: use of an Event Code will probably make other functions inoperable (e.g. cut/copy/paste, Undo, etc.). This is a trade off you need to accept if you really want this tool. Good Luck -- swatsp0p ------------------------------------------------------------------------ swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101 View this thread: http://www.excelforum.com/showthread...hreadid=483870 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
possible to merge a calender with speadsheet | Excel Discussion (Misc queries) | |||
how do I print 12 month calender in one sheet | Excel Discussion (Misc queries) | |||
How do I set up persian calender on office documents | Excel Discussion (Misc queries) | |||
Exel Calender drop down box 2005 | Excel Discussion (Misc queries) | |||
Determining Dates Within A Calender | Excel Worksheet Functions |