Find Throws Error 91
now you can ignore me completely, because i didn't realize that Google
wasn't being updated (once again) & that your post had already been replied
to, several times, in a much more intelligent manner than mine.
:)
susan
"Susan" wrote in message
ps.com...
dave -
given your great hacking experience (VBG LOL **JOKE!!!** **JOKE!!!**
don't shoot me! yours is probably more extensive than mine!), i am
assuming that your variables are all dim'med?
if not, switching back & forth between wbs without variables is bound
to result in excel being extremely confused, IMHO.
for instance, you don't have rngCells declared (but i guess it
wouldn't even get past that point if it wasn't dim'med earlier).
if these are indeed handled further up in your macro & you just didn't
bother posting them, then please ignore this portion of my post. :)
otherwise, i wonder if switching back & forth between "windows" is the
same (to excel) as switching back & forth between wbs & wkshts?? are
these 2 separate instances of excel?
just an idea
susan
On May 16, 12:15 pm, Dave Birley
wrote:
As any dedicated hacker would do, I have taken some code that works in a
macro and transplanted it. In the original code, I was popping back and
forth
between WS in a single WB. This hack involves two WBs:
Windows("Copy of 2003-07 Terminations.xls").Activate
With Range("B6", Range("B" & Rows.Count).End(xlUp)) 'Assume you have
header rows
For Each rngCell In .Cells
rngCell(1, 1).Select
varName = rngCell(1, 1).Value
Selection.Copy
Windows("Job-Personal-Fed and State Taxes
Trimmed-3.xls").Activate
Range("A1").Select
Cells.Find(What:=varName, After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
..and when I step through it to the Find statement, I get "Object
variable
or With block variable not set". I read the help file on this, but
couldn't
relate what it was trying to tell me to my code.
Where did I go wrong, mother dear?
--
Dave
Temping with Staffmark
in Rock Hill, SC
|