If the date is always read into the same cell (eg: A1), and EXACTLY the
same format (mm/dd/yyyy), you could try using your VBA to insert a
formula in an adjacent cell like:
=DATE(RIGHT(A1,4),LEFT(A1,2),MID(A1,4,2))
Or you just use the date, right, mid, and left worksheet functions
directly in your VBA code to calculate the date, assign it to a
variable, then over-write the cell with the date reference. This might
be the best way to go anyway, as doing something like:
Dim MyDate as String
MyDate = ThisWorkbook.Worksheets("Sheet1").Range("A1").Value
will read the date as a text string and make parsing it into
day/month/year a lot easier. I seem to remember a VBA
method/function/property (something anyway) which will read a string
into a user-specified date format. I can't find it at the moment, but
I'll keep looking in MSDN and let you know. I think it may be in
VB.NET rather than VBA????
BTW, does anyone out there know how to FORCE pasted data into the
previously set format of the destination cell? Is it as simple as
"paste special/values only"???
Regards,
Graeme
On or about 30/03/2004 11:37, Geoff Kelly was seen in the vicinity and
allegedly stated: