View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Date-Text Format

Dates are stored in VBA the same way as in Excel... as a Double. The integer
portion of the date represents the number of days from "date zero" (which in
VB is 12/30/1899) and the decimal portion of the number is the fraction of a
24-hour day. The best way to work with dates in VB is to keep them in a
variable Dim'med as Date and to use the various Date functions that VB
provides to manipulate them. The format of the Date, for example your mmddyy
format would be produced from the Format function, something like this as an
example...

FileName = "My File Dated " & Format(DateVariable, "mmddyy") & ".txt"

--
Rick (MVP - Excel)


"Bigfoot17" wrote in message
...
It seems things got off track on this one, which means I wasn't clear
enough.
Several suggestions are telling me how to format the cell. Well, I posted
this in the programming section because I am trying to understand how I
can
manipulate the contents of the cell. The data is place in the cell in the
format that is needed there, but I want to use this date elsewhere in VBA.