Find box

Haluk

Rules Violation
Joined
Oct 26, 2002
Messages
1,075
Hi all;

When I use one of the below procedures to invoke the XL's sandard "Find" dialog box, the dialog box is triggered but XL keeps telling me that the data I'm trying to find on the sheet is not found. But, it's allready there.

I'm using Office2000 on WinXP - Home edition.

The related procedures are;

Code:
Sub Test()
    Application.CommandBars.FindControl(ID:=1849).Execute
End Sub
'
Sub Test2()
    Application.Dialogs(xlDialogFormulaFind).Show
End Sub

Do you have any ideas ?
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi Raider,

Both test routines found the sample data that I tested with (WinXP(Home) and Excel2003).

Is there anything more specific that you can tell us?
 
Upvote 0
Hi Richie;

Unfortunately, there is nothing more to say about the strange problem...

I'm trying both of the procedures in a new WB where only the above codes are present and I've only the standard 3 sheets available (Sheet1, Sheet2 and Sheet3).

Sheet1 is the active one, there are 3 or 4 cells filled with arbitrary data ( such as "xx", "c", "abc"). Then, I invoke the find box and try to find one of the datas but no hope....

When I trigger the Find box from Edit | Find... menu everything is fine.

As I mentioned, I'm using XL2000 on WinXP(Home) and there isn't any Add-In installed.

Thanks for your response.
 
Upvote 0
I wonder if your doing an exact match rather than partial. When you've tried a new book is this in the same instance of the application. I believe the Find box doesnt reset until the application itself is closed.
 
Upvote 0
Hi Parry;

Partial, full, or match case or not ..., WB is saved or not ..... data is string or numeric ........ nothing makes any different.

Tomorrow, I'll try the same code on Office2000 / Win2000. Don't know if it'll make any difference.

Thanks for your response.
 
Upvote 0
Hi again Richie and parry;

I tested the above procedures at my office running Office2000 on Win2000 and, the result is the same. The search data can not be found.

But an interesting thing is that, when I select a range which includes the search data as well, both of procedures are working perfect.

So, what I come up with is this;


Code:
Sub Test()
    ActiveSheet.UsedRange.Select
    Application.CommandBars.FindControl(ID:=1849).Execute
End Sub
'
Sub Test2()
    ActiveSheet.UsedRange.Select
    Application.Dialogs(xlDialogFormulaFind).Show
End Sub

Thanks to both of you.
 
Upvote 0
Thanks for posting your solution Raider. This is very odd to have to select the range first. I notice that if I have an object on a sheet (say an embedded picture) and it has focus, the Find option is not available. Its almost as if the sheet doesnt have focus for you, but why I dont know.

If wonder if you need to reset the usedrange for some reason but that shouldnt be a factor in a new book. To reset the used range use the following. Note that the application qualifier needs to be included, rather than just Sheets(1).UsedRange.

Application.Sheets(1).UsedRange
 
Upvote 0
Excel2000 Findfunction Dialog acts differently then Xl2002+
Thats because the Dialog is not Modal where as xl2002+ is

In order to get this to Function you need to select a Range to work on 1st.....


eg

Code:
Cells.Select
With Application
   .CommandBars.FindControl(id:=1849).Execute
End With
 
Upvote 0
Hi Ivan;

Yes, the problem was related with the "show modal" property of the "Find" box in XL2000. When I tried the code in my last post, I realised the fact.

Thanks for your answer.
 
Upvote 0

Forum statistics

Threads
1,212,929
Messages
6,110,741
Members
448,295
Latest member
Uzair Tahir Khan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top