ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Toggle FIND criteria (https://www.excelbanter.com/excel-programming/365893-toggle-find-criteria.html)

Edmund

Toggle FIND criteria
 
In the FIND dialog box, I must activate checkbox €śFind entire cells only€ť
when the macro runs. This leaves this checkbox €śchecked€ť even after VBA code
execution ends.

I cant just use €śLookAt:=xlPart€ť within the sample code shown below as I
need VBA to be in €śLookAt:=xlWhole€ť mode during executing.

How can I toggle it back from checked to non-checked when macro ends?

My current recorded by VBA:
Selection.Find(What:=ItemNumber, After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate

Thanks in advance.

--
Edmund
(Using Excel 2000)

ben77[_10_]

Toggle FIND criteria
 

Hi,

Try adding this line at the end:


Code:
--------------------

Selection.Find(LookAt:=xlPart).Activate

--------------------


Hope this helps.

B



Edmund Wrote:
In the FIND dialog box, I must activate checkbox €śFind entire cells
only€ť
when the macro runs. This leaves this checkbox €śchecked€ť even after
VBA code
execution ends.

I cant just use €śLookAt:=xlPart€ť within the sample code shown
below as I
need VBA to be in €śLookAt:=xlWhole€ť mode during executing.

How can I toggle it back from checked to non-checked when macro ends?

My current recorded by VBA:
Selection.Find(What:=ItemNumber, After:=ActiveCell, LookIn:=xlFormulas
_
, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate

Thanks in advance.

--
Edmund
(Using Excel 2000)



--
ben77
------------------------------------------------------------------------
ben77's Profile: http://www.excelforum.com/member.php...o&userid=35602
View this thread: http://www.excelforum.com/showthread...hreadid=557171


ben77[_11_]

Toggle FIND criteria
 

Hi,

Try adding this line at the end:


Code:
--------------------

Selection.Find(LookAt:=xlPart).Activate

--------------------


Hope this helps.

B



Edmund Wrote:
In the FIND dialog box, I must activate checkbox €śFind entire cells
only€ť
when the macro runs. This leaves this checkbox €śchecked€ť even after
VBA code
execution ends.

I cant just use €śLookAt:=xlPart€ť within the sample code shown
below as I
need VBA to be in €śLookAt:=xlWhole€ť mode during executing.

How can I toggle it back from checked to non-checked when macro ends?

My current recorded by VBA:
Selection.Find(What:=ItemNumber, After:=ActiveCell, LookIn:=xlFormulas
_
, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate

Thanks in advance.

--
Edmund
(Using Excel 2000)



--
ben77
------------------------------------------------------------------------
ben77's Profile: http://www.excelforum.com/member.php...o&userid=35602
View this thread: http://www.excelforum.com/showthread...hreadid=557171



All times are GMT +1. The time now is 10:20 AM.

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