ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find arguments (https://www.excelbanter.com/excel-programming/397116-find-arguments.html)

Zone[_3_]

Find arguments
 
When I use Find in code, I generally want a "no-frills" find, so
Set c = Cells.Find("abc")
works just fine to find "abc" in the values, any part of the values,
ignoring case. But, testing this, I see that if the user has set find
options differently, find remembers and searches according to those rules.
Rats! So I have to include arguments, like
Set c = Cells.Find("abc", LookIn:=xlValues, lookat:=xlPart,
MatchCase:=False)
Is there anyway to set find back to "no frills", or default settings, so I
don't have to include all those arguments? TIA, James



Mike Fogleman

Find arguments
 
I'm afraid not. If those are the arguments you want .Find to use, and there
is a chance that they would be changed in the worksheet, then you have done
what needs to be done. Your only alternative would be to close Excel and
re-open it. The default settings would then be re-applied. Probably not what
you want to do.

Mike F
"Zone" wrote in message
...
When I use Find in code, I generally want a "no-frills" find, so
Set c = Cells.Find("abc")
works just fine to find "abc" in the values, any part of the values,
ignoring case. But, testing this, I see that if the user has set find
options differently, find remembers and searches according to those rules.
Rats! So I have to include arguments, like
Set c = Cells.Find("abc", LookIn:=xlValues, lookat:=xlPart,
MatchCase:=False)
Is there anyway to set find back to "no frills", or default settings, so I
don't have to include all those arguments? TIA, James





Zone[_3_]

Find arguments
 
Thank you, Mike. If I remember my basic rules about arguments, I could
include them without the argument names if I have them in the right order.
But it's probably more trouble than it's worth (and definitely more
dangerous) to try to remember where all those commas go. I hope I haven't
given anyone bad advice in here. I'll just include the arguments (and their
names) with Find from now on. Regards, James

"Mike Fogleman" wrote in message
m...
I'm afraid not. If those are the arguments you want .Find to use, and
there is a chance that they would be changed in the worksheet, then you
have done what needs to be done. Your only alternative would be to close
Excel and re-open it. The default settings would then be re-applied.
Probably not what you want to do.

Mike F
"Zone" wrote in message
...
When I use Find in code, I generally want a "no-frills" find, so
Set c = Cells.Find("abc")
works just fine to find "abc" in the values, any part of the values,
ignoring case. But, testing this, I see that if the user has set find
options differently, find remembers and searches according to those
rules. Rats! So I have to include arguments, like
Set c = Cells.Find("abc", LookIn:=xlValues, lookat:=xlPart,
MatchCase:=False)
Is there anyway to set find back to "no frills", or default settings, so
I don't have to include all those arguments? TIA, James







Rick Rothstein \(MVP - VB\)

Find arguments
 

"Zone" wrote in message
...
Thank you, Mike. If I remember my basic rules about arguments, I could
include them without the argument names if I have them in the right order.
But it's probably more trouble than it's worth (and definitely more
dangerous) to try to remember where all those commas go.


And much, much harder to read at some future date when you might be
reviewing your code for some reason. Which of these do you think you would
be able to figure out some months after you wrote them?

Set c=Cells.Find("abc", LookIn:=xlValues, LookAt:=xlPart, MatchCase:=False)

Set c=Cells.Find("abc", , xlValues, xlPart, , , False)

Rick


Zone[_3_]

Find arguments
 
Exactly, Rick!
"Rick Rothstein (MVP - VB)" wrote in
message ...

"Zone" wrote in message
...
Thank you, Mike. If I remember my basic rules about arguments, I could
include them without the argument names if I have them in the right
order. But it's probably more trouble than it's worth (and definitely
more dangerous) to try to remember where all those commas go.


And much, much harder to read at some future date when you might be
reviewing your code for some reason. Which of these do you think you would
be able to figure out some months after you wrote them?

Set c=Cells.Find("abc", LookIn:=xlValues, LookAt:=xlPart,
MatchCase:=False)

Set c=Cells.Find("abc", , xlValues, xlPart, , , False)

Rick




Dave Peterson

Find arguments
 
Or even:
Set c=Cells.Find(what:="abc", ...

<gd&r



"Rick Rothstein (MVP - VB)" wrote:

"Zone" wrote in message
...
Thank you, Mike. If I remember my basic rules about arguments, I could
include them without the argument names if I have them in the right order.
But it's probably more trouble than it's worth (and definitely more
dangerous) to try to remember where all those commas go.


And much, much harder to read at some future date when you might be
reviewing your code for some reason. Which of these do you think you would
be able to figure out some months after you wrote them?

Set c=Cells.Find("abc", LookIn:=xlValues, LookAt:=xlPart, MatchCase:=False)

Set c=Cells.Find("abc", , xlValues, xlPart, , , False)

Rick


--

Dave Peterson

Rick Rothstein \(MVP - VB\)

Find arguments
 
LOL.. Well, yeah, technically, but I consider the first argument a
"given"... not too many people I know decide to place a first argument
(whether it be "What" or anything thing else) out of sequence.

Rick


"Dave Peterson" wrote in message
...
Or even:
Set c=Cells.Find(what:="abc", ...

<gd&r



"Rick Rothstein (MVP - VB)" wrote:

"Zone" wrote in message
...
Thank you, Mike. If I remember my basic rules about arguments, I could
include them without the argument names if I have them in the right
order.
But it's probably more trouble than it's worth (and definitely more
dangerous) to try to remember where all those commas go.


And much, much harder to read at some future date when you might be
reviewing your code for some reason. Which of these do you think you
would
be able to figure out some months after you wrote them?

Set c=Cells.Find("abc", LookIn:=xlValues, LookAt:=xlPart,
MatchCase:=False)

Set c=Cells.Find("abc", , xlValues, xlPart, , , False)

Rick


--

Dave Peterson



Zone[_3_]

Find arguments
 
gd&r? Huh? Am I losing my web savvy? ;)

"Rick Rothstein (MVP - VB)" wrote in
message ...
LOL.. Well, yeah, technically, but I consider the first argument a
"given"... not too many people I know decide to place a first argument
(whether it be "What" or anything thing else) out of sequence.

Rick


"Dave Peterson" wrote in message
...
Or even:
Set c=Cells.Find(what:="abc", ...

<gd&r



"Rick Rothstein (MVP - VB)" wrote:

"Zone" wrote in message
...
Thank you, Mike. If I remember my basic rules about arguments, I
could
include them without the argument names if I have them in the right
order.
But it's probably more trouble than it's worth (and definitely more
dangerous) to try to remember where all those commas go.

And much, much harder to read at some future date when you might be
reviewing your code for some reason. Which of these do you think you
would
be able to figure out some months after you wrote them?

Set c=Cells.Find("abc", LookIn:=xlValues, LookAt:=xlPart,
MatchCase:=False)

Set c=Cells.Find("abc", , xlValues, xlPart, , , False)

Rick


--

Dave Peterson





Rick Rothstein \(MVP - VB\)

Find arguments
 
No, I saw the gd&r... I gave you a LOL in return.

Rick


"Zone" wrote in message
...
gd&r? Huh? Am I losing my web savvy? ;)

"Rick Rothstein (MVP - VB)" wrote in
message ...
LOL.. Well, yeah, technically, but I consider the first argument a
"given"... not too many people I know decide to place a first argument
(whether it be "What" or anything thing else) out of sequence.

Rick


"Dave Peterson" wrote in message
...
Or even:
Set c=Cells.Find(what:="abc", ...

<gd&r



"Rick Rothstein (MVP - VB)" wrote:

"Zone" wrote in message
...
Thank you, Mike. If I remember my basic rules about arguments, I
could
include them without the argument names if I have them in the right
order.
But it's probably more trouble than it's worth (and definitely more
dangerous) to try to remember where all those commas go.

And much, much harder to read at some future date when you might be
reviewing your code for some reason. Which of these do you think you
would
be able to figure out some months after you wrote them?

Set c=Cells.Find("abc", LookIn:=xlValues, LookAt:=xlPart,
MatchCase:=False)

Set c=Cells.Find("abc", , xlValues, xlPart, , , False)

Rick

--

Dave Peterson






Rick Rothstein \(MVP - VB\)

Find arguments
 
Whoops! The gd&r wasn't yours, was it? Ignore my other post... the gd&r
means "grin, duck and run".

Rick


"Zone" wrote in message
...
gd&r? Huh? Am I losing my web savvy? ;)

"Rick Rothstein (MVP - VB)" wrote in
message ...
LOL.. Well, yeah, technically, but I consider the first argument a
"given"... not too many people I know decide to place a first argument
(whether it be "What" or anything thing else) out of sequence.

Rick


"Dave Peterson" wrote in message
...
Or even:
Set c=Cells.Find(what:="abc", ...

<gd&r



"Rick Rothstein (MVP - VB)" wrote:

"Zone" wrote in message
...
Thank you, Mike. If I remember my basic rules about arguments, I
could
include them without the argument names if I have them in the right
order.
But it's probably more trouble than it's worth (and definitely more
dangerous) to try to remember where all those commas go.

And much, much harder to read at some future date when you might be
reviewing your code for some reason. Which of these do you think you
would
be able to figure out some months after you wrote them?

Set c=Cells.Find("abc", LookIn:=xlValues, LookAt:=xlPart,
MatchCase:=False)

Set c=Cells.Find("abc", , xlValues, xlPart, , , False)

Rick

--

Dave Peterson






Zone[_3_]

Find arguments
 
ty, Rick. I'm up to speed again! ;)

"Rick Rothstein (MVP - VB)" wrote in
message ...
Whoops! The gd&r wasn't yours, was it? Ignore my other post... the gd&r
means "grin, duck and run".

Rick


"Zone" wrote in message
...
gd&r? Huh? Am I losing my web savvy? ;)

"Rick Rothstein (MVP - VB)" wrote in
message ...
LOL.. Well, yeah, technically, but I consider the first argument a
"given"... not too many people I know decide to place a first argument
(whether it be "What" or anything thing else) out of sequence.

Rick


"Dave Peterson" wrote in message
...
Or even:
Set c=Cells.Find(what:="abc", ...

<gd&r



"Rick Rothstein (MVP - VB)" wrote:

"Zone" wrote in message
...
Thank you, Mike. If I remember my basic rules about arguments, I
could
include them without the argument names if I have them in the right
order.
But it's probably more trouble than it's worth (and definitely more
dangerous) to try to remember where all those commas go.

And much, much harder to read at some future date when you might be
reviewing your code for some reason. Which of these do you think you
would
be able to figure out some months after you wrote them?

Set c=Cells.Find("abc", LookIn:=xlValues, LookAt:=xlPart,
MatchCase:=False)

Set c=Cells.Find("abc", , xlValues, xlPart, , , False)

Rick

--

Dave Peterson







Dave Peterson

Find arguments
 
ty????
<gd&rvvf

(Thank you)
(Grin, duck and running, very very fast)

Zone wrote:

ty, Rick. I'm up to speed again! ;)

"Rick Rothstein (MVP - VB)" wrote in
message ...
Whoops! The gd&r wasn't yours, was it? Ignore my other post... the gd&r
means "grin, duck and run".

Rick


"Zone" wrote in message
...
gd&r? Huh? Am I losing my web savvy? ;)

"Rick Rothstein (MVP - VB)" wrote in
message ...
LOL.. Well, yeah, technically, but I consider the first argument a
"given"... not too many people I know decide to place a first argument
(whether it be "What" or anything thing else) out of sequence.

Rick


"Dave Peterson" wrote in message
...
Or even:
Set c=Cells.Find(what:="abc", ...

<gd&r



"Rick Rothstein (MVP - VB)" wrote:

"Zone" wrote in message
...
Thank you, Mike. If I remember my basic rules about arguments, I
could
include them without the argument names if I have them in the right
order.
But it's probably more trouble than it's worth (and definitely more
dangerous) to try to remember where all those commas go.

And much, much harder to read at some future date when you might be
reviewing your code for some reason. Which of these do you think you
would
be able to figure out some months after you wrote them?

Set c=Cells.Find("abc", LookIn:=xlValues, LookAt:=xlPart,
MatchCase:=False)

Set c=Cells.Find("abc", , xlValues, xlPart, , , False)

Rick

--

Dave Peterson





--

Dave Peterson

JMB

Find arguments
 
thank you, maybe????

"Dave Peterson" wrote:

ty????
<gd&rvvf

(Thank you)
(Grin, duck and running, very very fast)

Zone wrote:

ty, Rick. I'm up to speed again! ;)

"Rick Rothstein (MVP - VB)" wrote in
message ...
Whoops! The gd&r wasn't yours, was it? Ignore my other post... the gd&r
means "grin, duck and run".

Rick


"Zone" wrote in message
...
gd&r? Huh? Am I losing my web savvy? ;)

"Rick Rothstein (MVP - VB)" wrote in
message ...
LOL.. Well, yeah, technically, but I consider the first argument a
"given"... not too many people I know decide to place a first argument
(whether it be "What" or anything thing else) out of sequence.

Rick


"Dave Peterson" wrote in message
...
Or even:
Set c=Cells.Find(what:="abc", ...

<gd&r



"Rick Rothstein (MVP - VB)" wrote:

"Zone" wrote in message
...
Thank you, Mike. If I remember my basic rules about arguments, I
could
include them without the argument names if I have them in the right
order.
But it's probably more trouble than it's worth (and definitely more
dangerous) to try to remember where all those commas go.

And much, much harder to read at some future date when you might be
reviewing your code for some reason. Which of these do you think you
would
be able to figure out some months after you wrote them?

Set c=Cells.Find("abc", LookIn:=xlValues, LookAt:=xlPart,
MatchCase:=False)

Set c=Cells.Find("abc", , xlValues, xlPart, , , False)

Rick

--

Dave Peterson





--

Dave Peterson


Dave Peterson

Find arguments
 
I think so, too.

JMB wrote:

thank you, maybe????

"Dave Peterson" wrote:

ty????
<gd&rvvf

(Thank you)
(Grin, duck and running, very very fast)

Zone wrote:

ty, Rick. I'm up to speed again! ;)

"Rick Rothstein (MVP - VB)" wrote in
message ...
Whoops! The gd&r wasn't yours, was it? Ignore my other post... the gd&r
means "grin, duck and run".

Rick


"Zone" wrote in message
...
gd&r? Huh? Am I losing my web savvy? ;)

"Rick Rothstein (MVP - VB)" wrote in
message ...
LOL.. Well, yeah, technically, but I consider the first argument a
"given"... not too many people I know decide to place a first argument
(whether it be "What" or anything thing else) out of sequence.

Rick


"Dave Peterson" wrote in message
...
Or even:
Set c=Cells.Find(what:="abc", ...

<gd&r



"Rick Rothstein (MVP - VB)" wrote:

"Zone" wrote in message
...
Thank you, Mike. If I remember my basic rules about arguments, I
could
include them without the argument names if I have them in the right
order.
But it's probably more trouble than it's worth (and definitely more
dangerous) to try to remember where all those commas go.

And much, much harder to read at some future date when you might be
reviewing your code for some reason. Which of these do you think you
would
be able to figure out some months after you wrote them?

Set c=Cells.Find("abc", LookIn:=xlValues, LookAt:=xlPart,
MatchCase:=False)

Set c=Cells.Find("abc", , xlValues, xlPart, , , False)

Rick

--

Dave Peterson





--

Dave Peterson


--

Dave Peterson

Zone[_3_]

Find arguments
 
tyvm, although maybe tmi for this ng, imho! <gd&r

"Dave Peterson" wrote in message
...
I think so, too.

JMB wrote:

thank you, maybe????

"Dave Peterson" wrote:

ty????
<gd&rvvf

(Thank you)
(Grin, duck and running, very very fast)

Zone wrote:

ty, Rick. I'm up to speed again! ;)

"Rick Rothstein (MVP - VB)" wrote
in
message ...
Whoops! The gd&r wasn't yours, was it? Ignore my other post... the
gd&r
means "grin, duck and run".

Rick


"Zone" wrote in message
...
gd&r? Huh? Am I losing my web savvy? ;)

"Rick Rothstein (MVP - VB)"
wrote in
message ...
LOL.. Well, yeah, technically, but I consider the first argument
a
"given"... not too many people I know decide to place a first
argument
(whether it be "What" or anything thing else) out of sequence.

Rick


"Dave Peterson" wrote in message
...
Or even:
Set c=Cells.Find(what:="abc", ...

<gd&r



"Rick Rothstein (MVP - VB)" wrote:

"Zone" wrote in message
...
Thank you, Mike. If I remember my basic rules about
arguments, I
could
include them without the argument names if I have them in the
right
order.
But it's probably more trouble than it's worth (and
definitely more
dangerous) to try to remember where all those commas go.

And much, much harder to read at some future date when you
might be
reviewing your code for some reason. Which of these do you
think you
would
be able to figure out some months after you wrote them?

Set c=Cells.Find("abc", LookIn:=xlValues, LookAt:=xlPart,
MatchCase:=False)

Set c=Cells.Find("abc", , xlValues, xlPart, , , False)

Rick

--

Dave Peterson





--

Dave Peterson


--

Dave Peterson





All times are GMT +1. The time now is 08:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com