Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK, I messed around with it long enough to discover the problem was in a cell
that appeared to be blank but for some reason was being read as having something in it (other than a date). I don't know why it didn't work before, but after running it again, your isdate value check did find this offending cell. Thanks for your help! "Jim Thomlinson" wrote: AS a guess you are looking for dates that fall between a start and end date? Are all of the cel values dates that you would be camparing... Try adding an isdate value check to your code to determine the nature of the cell value... For Each cell In TimeSrcRng if not isdate(cell.value) then msgbox cell.address '*** If cell.Value < "" Then If cell.Value = dtStart And cell.Offset(0, 1).Value <= dtEnd Then cell1 = cell.Offset(0, -2).Value Set cell1 = cell1.Offset(1, 0) End If End If Next -- HTH... Jim Thomlinson "Jay" wrote: I have two workbooks that have been set up with the same layout and formating etc. When I run a macro that contains the following code (see below), pointed to one workbook, everything runs fine. But when I point to the other workbook, I get a Run-time error '13': Type mismatch. Code from macro: For Each cell In TimeSrcRng If cell.Value < "" Then If cell.Value = dtStart And cell.Offset(0, 1).Value <= dtEnd Then cell1 = cell.Offset(0, -2).Value Set cell1 = cell1.Offset(1, 0) End If End If Next The error occures on line: If cell.Value = dtStart And cell.Offset(0, 1).Value <= dtEnd Then How can I figure out what's wrong with the second workbook? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
runtime error 13 - type mismatch error in Excel 97 on Citrix | Excel Programming | |||
Conditional Formatting - Run Time Error '13' Type Mismatch Error | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error | Excel Programming |