Date Format
The "m", "d", and "y" meta-characters only work if the value (first
argument) is a *real* date value
I take this statement back... Format happily converts the String date back
to a *real* date value automatically. The code you posted works fine, so
that is not the source of your error.
but I am wondering why you went through the intermediate step of assigning
Date to a variable in the first place, just use it directly...
strTest = Format(Date, "mm-dd-yy")
The above comment still holds though.
--
Rick (MVP - Excel)
|