Convert date to serial number
Still doesn't do what I want. In my VBA I added:
dateval = Format(valDate, 0)
where valDate is a date taken from a dialog box calendar. I concatenate with
another variable with value 2, and get the result 3/26/20092, when I'm trying
to get 398982
"Mike H" wrote:
Sorry you want it as a string so leave out the *1
x = Format(Range("A1").Value, 0)
Miuke
"Mike H" wrote:
Try
x = Format(Range("A1").Value, 0) * 1
With a date in A1
Mike
"callbr549" wrote:
I want to convert a date value to the serial number for that date and store
it in a string variable for later manipulation. All I can get is the value
stored in a date format, for example "3/27/2009". The spreadsheet I'm
working on uses the Excel Concatenate function to add a suffix to a date, and
the date comes out in serial number format. So for example, adding "1" to
today's date, the resulting cell reads "398991", but when I try to do the
same thing in VBA I can only get the resulting string to be "3/24/20091".
|