Finding outside set range

  • Thread starter Thread starter Sue
  • Start date Start date
S

Sue

I am using Excel 2000 and have the following code:
With Worksheets("Data Lists").Range(WorkRange)
Set MyEdit = Cells.Find(AccCode, , xlValues, xlWhole, xlByColumns)
End With
This does find the AccCode in the WorkRange BUT it also finds the AccCode
outside the WorkRange. Why? How can I stop that?
 
Even though you have that "with" statement, you're not using it in the .find
statement.

set myedit = .cells.find(...)

Notice the dot in front of the word cells.
 
Thank you so much - I have tested with the . and my problem is solved!
I also realise I have other code with the same issue which I will now correct!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top