H
Hari
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
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