ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Returning a date as a serial umber (https://www.excelbanter.com/excel-programming/281317-returning-date-serial-umber.html)

David

Returning a date as a serial umber
 
I have a datetime as a variant variable. How can I format
it as the equivalent serial number?

Harald Staff

Returning a date as a serial umber
 
Sub test()
Dim D As Date
D = Now
MsgBox Format(D, "General Number")
End Sub

(You should use a Date and not a Variant if Datetime is what it's filed with
at all times)
--
HTH. Best wishes Harald
Followup to newsgroup only please

"David" skrev i melding
...
I have a datetime as a variant variable. How can I format
it as the equivalent serial number?





All times are GMT +1. The time now is 09:10 PM.

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