View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Showing a calculated Date as a string

ActiveWorkbook.Names.Add Name:="FinYear", _
RefersTo:="=""" & Format(MyDate,"dd mmm yyyy") & """

--
Regards,
Tom Ogilvy


"Pavlos" wrote in message
...
In my code I have calculated the date using the DateSerial command.
This seems to work fine and gives the correct date when I use:

Debug.Print MyDate
29 Feb 2004

However I'm trying now to assign this date to a name as a string so that I
can use it in concatenated text.
I also don't want to write the value directly to the spreadsheet, so the
instruction I am using is
ActiveWorkbook.Names.Add Name:="FinYear", RefersTo:=MyDate

Ths is not saving the date a a string but instead is giving me a serial no
value.

Can anybody tell me a way around this?

.- -. Bye Bye
/|6 6|\ - Pavlos
{/(_0_)\}
/ ^ \_
(/_/^\_\)