Hi All,
I'm trying to loop through an excel range of dates from access vba. I want the loop to end when the date in my range matches the the current year and month. Problem is that not every cell is in date format so i could have...
01/01/09, 01/02/09, total 09, etc....
when it get to the total 09 cell the loop fails and says type mismatch. Is there a way to handle this??
many thanks, spin.
I'm trying to loop through an excel range of dates from access vba. I want the loop to end when the date in my range matches the the current year and month. Problem is that not every cell is in date format so i could have...
01/01/09, 01/02/09, total 09, etc....
when it get to the total 09 cell the loop fails and says type mismatch. Is there a way to handle this??
Code:
Do
Loop Until Month(xlsht.cells(iRow, iColCount).Value) = Month(Now()) And _
Year(xlsht.cells(iRow, iColCount).Value) = Year(Now())
many thanks, spin.