Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formatting a date as a serial number

How can I return a formatted date as a serial number in
Excel 97?

FormatNumber(TheDate) works in Excel 2002, but is not
supported in Excel 97.

David

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Formatting a date as a serial number

Use the Format function

MsgBox Format(Range("a1"), "0")


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



"David" wrote in message ...
How can I return a formatted date as a serial number in
Excel 97?

FormatNumber(TheDate) works in Excel 2002, but is not
supported in Excel 97.

David



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Formatting a date as a serial number

? FormatNumber(date)
37,922.00
? format(date,"##,###.00")
37,922.00
? cdbl(date)
37922


--
Regards,
Tom Ogilvy

"David" wrote in message
...
How can I return a formatted date as a serial number in
Excel 97?

FormatNumber(TheDate) works in Excel 2002, but is not
supported in Excel 97.

David



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Formatting a date as a serial number

This will do what you want.

Selection.NumberFormat = "0"

Good Luck
Mic

-----Original Message-----
How can I return a formatted date as a serial number in
Excel 97?

FormatNumber(TheDate) works in Excel 2002, but is not
supported in Excel 97.

David

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Formatting a date as a serial number

Depends what you mean by "serial number"!

My guess is you mean a date like today's: 10/28/03 returns the number
20031028, in which case you could give the cell a custom format, "yyyymmdd"
or you could use a formula like this:

=YEAR(B1)&MONTH(B1)&DAY(B1)

HTH,
Shockley

"David" wrote in message
...
How can I return a formatted date as a serial number in
Excel 97?

FormatNumber(TheDate) works in Excel 2002, but is not
supported in Excel 97.

David





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
how to return a serial number to a date Holly Excel Discussion (Misc queries) 7 March 11th 10 04:50 AM
how to now what date represent a serial number? cubanoluso Excel Worksheet Functions 4 April 25th 07 03:54 PM
convert serial number into date santhu Excel Discussion (Misc queries) 2 October 28th 06 10:27 AM
Serial number of Date Gazzr Excel Worksheet Functions 2 March 24th 06 08:59 AM
Convert date to serial number in VBA Michael J. Malinsky Excel Programming 1 September 10th 03 08:43 PM


All times are GMT +1. The time now is 04:00 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"