ExcelBanter

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

Chris

Calendar
 
Hi,

I'm trying to put a calendar in excel so that the selected date will return
the date value (e.g. 1st January 2007 shall return 39083) as I need to use
this date to run different formulae.

I've managed to insert-object-calendar, but can't find any way of allowing
the calendar to return me this value.

Can anyone help?

Thanks in advance.

Chris

Ron de Bruin

Calendar
 
Hi Chris

See
http://www.rondebruin.nl/calendar.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Chris" wrote in message ...
Hi,

I'm trying to put a calendar in excel so that the selected date will return
the date value (e.g. 1st January 2007 shall return 39083) as I need to use
this date to run different formulae.

I've managed to insert-object-calendar, but can't find any way of allowing
the calendar to return me this value.

Can anyone help?

Thanks in advance.

Chris


Jim Thomlinson

Calendar
 
If you are ok with the date formated as date then you can just use the linked
cell property of the calendar. Put the spreadsheet into design mode and right
click on the Calendar - View Properties - Linked Cell. By default the
format of this cell will be date. From there you could use a formula that
references the linked cell to get the serial date something like this. =A1 +
0 where A1 is the linked cell. You can format this cell as number to get your
39083

If you need the serial value of the date directly then you need to get a bit
more fancy by using code somethin like this placed directy in the sheet the
calendar is on (right click the sheet tab and seelct view code)

Private Sub Calendar1_Click()
Range("A1").Value = Calendar1.Value
End Sub

--
HTH...

Jim Thomlinson


"Chris" wrote:

Hi,

I'm trying to put a calendar in excel so that the selected date will return
the date value (e.g. 1st January 2007 shall return 39083) as I need to use
this date to run different formulae.

I've managed to insert-object-calendar, but can't find any way of allowing
the calendar to return me this value.

Can anyone help?

Thanks in advance.

Chris



All times are GMT +1. The time now is 02:27 AM.

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