A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » New Users to Excel
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Tags: , , ,

how to use the search dialog box ?



 
 
Thread Tools Display Modes
  #1  
Old February 15th 05, 07:10 PM
cyrille
external usenet poster
 
Posts: n/a
Default how to use the search dialog box ?

Hello Everybody,
I have a question concerning the opening of dialogs box. I would like to
open the Search Dialog Box. My stupid code is like this :

Private Sub CommandButtonSearch_Click()
'ouvre la boite de dialogue Rechercher
Application.Dialogs(xlDialogFormulaFind).Show
End Sub

With this code, the problem is that the Search Dialog box is indeed open
but whatever the text to find in the worksheet, there is no result. If I
stop the macro, open by hand the Search Dialog box and type the same
text, it works... Can you help me to solve this problem ?
Thanks a lot in advance.
Cyrille
Ads
  #2  
Old February 16th 05, 01:17 AM
Jim Rech
external usenet poster
 
Posts: n/a
Default

Some or all Excel versions before Excel 2000 had this problem. When run
from a macro the way you're doing it Excel would only search the range
selected when the macro is run. This is usually just one cell. One way to
overcome this:

Private Sub CommandButton1_Click()
Cells.Select
Application.Dialogs(xlDialogFormulaFind).Show
ActiveCell.Select
End Sub

This was fixed in Excel 2002 and later.

--
Jim Rech
Excel MVP
"cyrille" > wrote in message
...
> Hello Everybody,
> I have a question concerning the opening of dialogs box. I would like to
> open the Search Dialog Box. My stupid code is like this :
>
> Private Sub CommandButtonSearch_Click()
> 'ouvre la boite de dialogue Rechercher
> Application.Dialogs(xlDialogFormulaFind).Show
> End Sub
>
> With this code, the problem is that the Search Dialog box is indeed open
> but whatever the text to find in the worksheet, there is no result. If I
> stop the macro, open by hand the Search Dialog box and type the same
> text, it works... Can you help me to solve this problem ?
> Thanks a lot in advance.
> Cyrille



  #3  
Old February 17th 05, 11:28 PM
cyrille
external usenet poster
 
Posts: n/a
Default

Jim Rech wrote:
> Some or all Excel versions before Excel 2000 had this problem. When run
> from a macro the way you're doing it Excel would only search the range
> selected when the macro is run. This is usually just one cell. One way to
> overcome this:
>
> Private Sub CommandButton1_Click()
> Cells.Select
> Application.Dialogs(xlDialogFormulaFind).Show
> ActiveCell.Select
> End Sub
>
> This was fixed in Excel 2002 and later.
>

Thanks a lot for your help !
Very nice to see such a compatibility ... ;-)
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel's Dialog Box Dialog Box Excel Discussion (Misc queries) 1 February 12th 05 01:53 PM
how to search in excel with condition David Excel Discussion (Misc queries) 1 February 8th 05 10:23 PM
can i make a formula to search keywords in a excel workbook? gorillayam Excel Worksheet Functions 0 January 15th 05 03:25 AM
Search for a specific character in a cell in an if statement mcl Excel Worksheet Functions 2 January 4th 05 10:14 PM
Search problems BigPig Excel Worksheet Functions 0 December 29th 04 09:11 PM


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©2004-2010 ExcelBanter.
The comments are property of their posters.