ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Capture Find Settings (https://www.excelbanter.com/excel-programming/350165-capture-find-settings.html)

Jim Thomlinson[_5_]

Capture Find Settings
 
Range.Find takes a number of argument. What, LookIn, LookAt, SearchDirection,
.... These settings are saved each time you run a find meaning that in order
to be safe you are best off to supply values for each of the arguments.
However when you do this the values are saved and when the end user brings up
their Find or Find and Replace dialogue they are presented with whetever
settings that the code left them at. My question... Is there a way to capture
these settings prior to running the Find code so that you can restore them to
their original state when the find code is complete.
--
HTH...

Jim Thomlinson

Dave Peterson

Capture Find Settings
 
I don't think you can capture them.

But you could do a dummy .find (or .replace) and set them back to what you think
should be close to the defaults.



Jim Thomlinson wrote:

Range.Find takes a number of argument. What, LookIn, LookAt, SearchDirection,
... These settings are saved each time you run a find meaning that in order
to be safe you are best off to supply values for each of the arguments.
However when you do this the values are saved and when the end user brings up
their Find or Find and Replace dialogue they are presented with whetever
settings that the code left them at. My question... Is there a way to capture
these settings prior to running the Find code so that you can restore them to
their original state when the find code is complete.
--
HTH...

Jim Thomlinson


--

Dave Peterson

Peter T

Capture Find Settings
 
I've never found a way to capture them either. As well as restoring assumed
default settings I clear the search string, which is otherwise retained

x = ActiveSheet.Cells.Find("") ' plus other "unchecked" arg's

Regards,
Peter T

"Dave Peterson" wrote in message
...
I don't think you can capture them.

But you could do a dummy .find (or .replace) and set them back to what you

think
should be close to the defaults.



Jim Thomlinson wrote:

Range.Find takes a number of argument. What, LookIn, LookAt,

SearchDirection,
... These settings are saved each time you run a find meaning that in

order
to be safe you are best off to supply values for each of the arguments.
However when you do this the values are saved and when the end user

brings up
their Find or Find and Replace dialogue they are presented with whetever
settings that the code left them at. My question... Is there a way to

capture
these settings prior to running the Find code so that you can restore

them to
their original state when the find code is complete.
--
HTH...

Jim Thomlinson


--

Dave Peterson




Jim Thomlinson[_5_]

Capture Find Settings
 
Thanks Dave and Peter. I was starting to get the impression that I could not
capture that info but I thought I would ask.
--
HTH...

Jim Thomlinson


"Dave Peterson" wrote:

I don't think you can capture them.

But you could do a dummy .find (or .replace) and set them back to what you think
should be close to the defaults.



Jim Thomlinson wrote:

Range.Find takes a number of argument. What, LookIn, LookAt, SearchDirection,
... These settings are saved each time you run a find meaning that in order
to be safe you are best off to supply values for each of the arguments.
However when you do this the values are saved and when the end user brings up
their Find or Find and Replace dialogue they are presented with whetever
settings that the code left them at. My question... Is there a way to capture
these settings prior to running the Find code so that you can restore them to
their original state when the find code is complete.
--
HTH...

Jim Thomlinson


--

Dave Peterson



All times are GMT +1. The time now is 12:12 PM.

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