LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
cyrille
 
Posts: n/a
Default

Hi Bernie,
Thanks a lot! Now I understood that (at least with with Excel2000) one
search is applied to the whole worksheet when it is manually done (via
the menu) and only applied to previously selected cells when it is done
via a macro... I should have think about it !
Cheers !


Bernie Deitrick wrote:

Cyrille,

Everything should grey out, just as you describe, and stay greyed out, until
you press the close button.

Try this code. Select a cell other than the one you want to find, then click
your button. You should get the address of the cell you selected in a
message, then the dialog should appear after clicking OK. Do the search,
then click the close button on the dialog. You should then get the address
of the found cell in another message.

Private Sub CommandButtonSearch_Click()
MsgBox ActiveCell.Address
Application.Dialogs(xlDialogFormulaFind).Show
MsgBox ActiveCell.Address
End Sub

HTH,
Bernie
MS Excel MVP

"cyrille" wrote in message
...

Thanks Bernie for your proposition.
Anyway, I would like to understand the reason why it is not working with
my code.. Just a clue (maybe for U...) : when the Search dialog box is
opened by the macro, all icons, for instance from the standard tools
bar turn to grey until I close the Search Dialog box AND I click one
cell into the worksheet. Could it be possible that the instruction :
Application.Dialogs(xlDialogFormulaFind).Show

is only showing the Dialog but not allowing to work with it ?
Just in case, I'm using Excel2000 SR1 (OS= XP Pro)
Thanks for all your expert advices.
Cyrille

Bernie Deitrick wrote:


Cyrille,

Your code works for me. But if you have problems, you can use the find
method:

Sub TryNow()
Dim myCell As Range
Set myCell = Cells.Find(InputBox("What do you want to find"))
If Not myCell Is Nothing Then
MsgBox "That was found in cell " & myCell.Address
End If
End Sub

HTH,
Bernie
MS 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



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to use the search dialog box ? cyrille New Users to Excel 2 February 17th 05 10:28 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
macro to search and replace with offset Tim Excel Discussion (Misc queries) 5 December 11th 04 09:30 PM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM
search macro laprosa Excel Discussion (Misc queries) 0 November 26th 04 05:08 PM


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

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

About Us

"It's about Microsoft Excel"