TheAntiGates
09-16-2008, 03:40 PM
The attached blows up on a seemingly innocuous worksheets(i).UsedRange.Find.
It's yet another case of the ineptly programmed 'Error 13 Type mismatch' where you are told almost nothing in the error message. (Way to go, Excel authors.)
Sometimes, reissuing the .Find except changing
After:=ActiveCell.SpecialCells(xlLastCell)
to
After:=ActiveCell
goes cleanly, yet sometimes it bombs either way. Running the attached on XL03 shows both cases.
Just run the macro, or step it - it's extremely short and very quickly shows the problem in 2 flavors.
The first time, the xlLastCell code errors, but then After:=ActiveCell works.
The second time, the xlLastCell code errors, and then After:=ActiveCell also errors.
I'm completely out of ideas here. :help:banghead:
It's yet another case of the ineptly programmed 'Error 13 Type mismatch' where you are told almost nothing in the error message. (Way to go, Excel authors.)
Sometimes, reissuing the .Find except changing
After:=ActiveCell.SpecialCells(xlLastCell)
to
After:=ActiveCell
goes cleanly, yet sometimes it bombs either way. Running the attached on XL03 shows both cases.
Just run the macro, or step it - it's extremely short and very quickly shows the problem in 2 flavors.
The first time, the xlLastCell code errors, but then After:=ActiveCell works.
The second time, the xlLastCell code errors, and then After:=ActiveCell also errors.
I'm completely out of ideas here. :help:banghead: