ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   code works in excel 2002, but not in excel 2003 (https://www.excelbanter.com/excel-programming/308743-code-works-excel-2002-but-not-excel-2003-a.html)

pyc

code works in excel 2002, but not in excel 2003
 
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..

--
Message posted from http://www.ExcelForum.com


JE McGimpsey

code works in excel 2002, but not in excel 2003
 
Works for me in both XL03 and XL04.

Are you sure the cell contains what you posted?


In article ,
pyc wrote:

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...


Jim Rech

code works in excel 2002, but not in excel 2003
 
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
"pyc " wrote in message
...
| 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...
|
|
| ---
| Message posted from http://www.ExcelForum.com/
|




All times are GMT +1. The time now is 01:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com