Find, Findnext VBA Loop

  • Thread starter Thread starter SMS - John Howard
  • Start date Start date
S

SMS - John Howard

I am using a Find, FindNext loop in a vba macro in Excel XP professional on
a Windows 2000 platform.

The procedure works fine with the exception of finding the SECOND instance
of the criteria and not the first when the criteria is met in the first row
of the search range.

I presume this is the default.

The only methods I am adding are Lookin xlValues and Lookat xlWhole.

How can I enforce finding the first instance.

I have, for now used a workaround of redfining the search range with an
additional top row.
This is however hardly very elegant nor usable in all instances.

Can anyone assist


Regards

John Howard
Sydney, Australia
 
SMS said:
I am using a Find, FindNext loop in a vba macro in Excel XP professional on
a Windows 2000 platform.

The procedure works fine with the exception of finding the SECOND instance
of the criteria and not the first when the criteria is met in the first row
of the search range.

I presume this is the default.

The only methods I am adding are Lookin xlValues and Lookat xlWhole.

How can I enforce finding the first instance.

I have, for now used a workaround of redfining the search range with an
additional top row.
This is however hardly very elegant nor usable in all instances.

Can anyone assist


Regards

John Howard
Sydney, Australia
Add a second parameter After:=[the last cell in the range]

Alan Beban
 
John
To add to what Alan gave you. If your range is a variable, say,
MyRange, then use:
After:=MyRange(MyRange.Count)
HTH Otto
 
Alan and Otto,

Many thanks.
Your solutions worked perfectly

Regards

John Howard
Sydney, Australia
 
SMS said:
Alan and Otto,

Many thanks.
Your solutions worked perfectly

Regards

John Howard
Sydney, Australia

You're welcome. Thanks for the feedback.

Alan Beban
 

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

Similar Threads

Why is my .Findnext not working? 4
.FindNext problem 3
loops 3
Find / FindNext Trouble 2
FindNext Errors 6
interactive findnext 2
Loop 3
Find and FindNext...from Excel VBA Help generates 91 error. 11

Back
Top