I have cell entries formatted as dates, for instance appaering in the cell as 23-Sep and in the formula bar as 23/09/2005. In my VBA, I'm trying to use statements like:
cbxQuoteDateSentDay.ListIndex = CInt(Day(rng.Cells(1, i).Value)) - 1 or
cbxQuoteDateSentDay.ListIndex = CInt(Day(rng.Cells(1, i).Formula)) - 1
and I keep receiving a type mismatch. The same thing works fine using Month(), with or without the CInt casting. Further, running:
MsgBox Day("3/10/2005")
returns 3 as expected.
I've tried every variation I can think of, using #, ", CDate(), CInt() ... to no avail. OK, what's the secret?
Alan



