"find" finesse needed
:) i have my workbooks & worksheets straight now, thanks to jim!
i need to find a variable in a range, but without selecting the range,
i can't tell it to look after:activecell. i searched the newsgroup &
discovered using cells.count but it's not working. what am i doing
wrong (again)?
xxxxxxxxxxx
Sub ActualCopy()
LastRangeRow = wsMyInvoiceSheet.Cells(20000, 7).End(xlUp).Row
Set r = Range("g1:g" & LastRangeRow)
'find the program name in wsMyInvoiceSheet
r.Cells.Find(What:=myProgram, After:=r(r.Cells.Count),
LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate
<snip
End Sub
xxxxxxxxxxxxxxx
i'm getting my favorite run-time 91 error.
if i change the range to
Set r = wsMyInvoiceSheet.Range("g1:g" & LastRangeRow)
it bombs on the same "find" line, but with a different error message:
run time error 1004 - activate method of range class failed.
suggestions gratefully accepted! thanks
susan
|