Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Rephrasing argument for typename and a different result
Hi,
I have the following code which executes perfectly. dates = Sheets(sheetName).Cells(n, 2) If TypeName(dates) < "Date" Then Sheets(sheetName).Cells(n, 2).Interior.ColorIndex = 6 NoOfErrors = NoOfErrors + 1 Else If I rewrite the above code as given below and run it ( without changing any data in the worksheet) then it highlights an error in the cell which has date only. How is the 2 codes different from each other? If TypeName((Sheets(sheetName).Cells(n, 2)) < "Date" Then Sheets(sheetName).Cells(n, 2).Interior.ColorIndex = 6 NoOfErrors = NoOfErrors + 1 Else Regards, Hari India |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Rephrasing Interior.ColorIndex 36 question. | New Users to Excel | |||
Function argument correct result but answer 0 in cell? | Excel Worksheet Functions | |||
Advanced formula - Return result & Show Cell Reference of result | Excel Worksheet Functions | |||
vlookup based on random result returns incorrect result | Excel Worksheet Functions | |||
dynamic arrays as an argument/result in programmed functions | Excel Programming |