code works in excel 2002, but not in excel 2003

P

pyc

Cells(j, 1) = DateValue(Cells(j, 1)) + TimeValue(Cells(j, 1))

this is the line, and the error message is "type mismatch" ... sam
code works in excel 2002, but not in 2003.

The date is in format: 01-Dec-02 10:18:59 AM


please help.... it must be a classic problem..
 
J

JE McGimpsey

Works for me in both XL03 and XL04.

Are you sure the cell contains what you posted?
 
J

Jim Rech

I get a type mismatch error in Excel 2003 and 2002 only if the cell entry
cannot be interpreted as a date/time. It may be that your Windows regional
setting for date format is different than the format in the cell. Why it
would work in one version of Excel and not another is a mystery to me.

--
Jim Rech
Excel MVP
| Cells(j, 1) = DateValue(Cells(j, 1)) + TimeValue(Cells(j, 1))
|
| this is the line, and the error message is "type mismatch" ... same
| code works in excel 2002, but not in 2003.
|
| The date is in format: 01-Dec-02 10:18:59 AM
|
|
| please help.... it must be a classic problem...
|
|
| ---
|
|
 
Top