I have the following code. But it is giving me a type mismatch error on Excel 2013 but works fine in Excel 2010.
For Each dateRow In ThisWorkbook.Sheets(1).Range("G8:G153").Cells
cEndDate = DateValue(dateRow)
dateArray = Split(cEndDate , "-")
Day = CInt(dateArray(0)) 'I get the error here
'<- more code ->
Next
This is working fine with no error in Excel 2010.
Debug.Print dateArray(0)the row before the error. - R3uK"31"- good.learner