Excel VBA "After" property in Find

Hi
I am a little confused by the After property in find
If I want to find a value on the whole spreadsheet and I use After:=Range("A1")
will "A1" be included in the search?


   Cells.Find(What:="Budget Vs Actual 2015", After:=Range("A1"), LookIn:= _
        xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
        xlNext, MatchCase:=False, SearchFormat:=False).Activate
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
No. Imagine it to be the result of a prior search - you don't want it to be included in the search.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ProfessorJimJamMicrosoft Excel ExpertCommented:
It won't search A1
Instead use cell. Count method
0
ProfessorJimJamMicrosoft Excel ExpertCommented:
After:=.cells(.cells.count) like this
0
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

ProfessorJimJamMicrosoft Excel ExpertCommented:
.Find(What:="budget vs actual", _ After:=.Cells(.Cells.Count), _ LookIn:=xlFormulas, _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False)
0
Saqib Husain, SyedEngineerCommented:
Yes, if that address is included in the range to be searched.

This address would be returned if no other cell contains the value to be searched.
0
Martin LissOlder than dirtCommented:
After:= is not required, so just leave it out.
0
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks
0
Saqib Husain, SyedEngineerCommented:
There is one answer which says No and another which says Yes. How can both be correct?
0
Martin LissOlder than dirtCommented:
There is one answer which says No and another which says Yes. How can both be correct?
I assume the asker was just being kind, and spreading the points between everyone who contributed.
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
The correct answer is a mixture of both http:#a40707050 and http:#a40707058:
No, unless there is no other cell containing the value to be searched.

Martin's comment is correct, too - no need to use After if the cell should be included in the search.
But I cannot see how http:#a40707052 can be of any use.
0
ProfessorJimJamMicrosoft Excel ExpertCommented:
Martin,

 if my post wasn't of any use, then i do not need free points. please remove the points from my answer.

besides, perhaps i misunderstood the question, or otherwise my answer was useful to the OP.
0
Martin LissOlder than dirtCommented:
Martin, ...please remove the points from my answer.
I'm only a lowly cleanup volunteer so I don't have that ability. If you really don't want the points you could 'Request Attention' to this thread and a moderator might oblige you.
0
ProfessorJimJamMicrosoft Excel ExpertCommented:
if it is too much trouble, then i wont bother.

thanks Martin
0
Martin LissOlder than dirtCommented:
While I think I'd get points in either case (and more if the Professor's answer wasn't included), I think we should just leave it the way the Asker closed it.
0
Saqib Husain, SyedEngineerCommented:
The question was
will "A1" be included in the search?

The answer should either be a Yes or a No, not both. We cannot leave the answers as-is for future readers.
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Some questions cannot be answered with yes or no only. Sometimes "it depends" is correct
0
Saqib Husain, SyedEngineerCommented:
You can reject both but not select both.
0
Martin LissOlder than dirtCommented:
I think that unless it's grossly the wrong action that the user can do whatever he wants. I'm sure that I could find more than one question where one of the accepted answers was questionable.

I'll say no more here.
0
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
To clarify, the answers are not opposites and not simply Yes or No. There is definite overlapping and the advice was useful from all of you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.