Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Button to allow a search

I would like to be able to click on a command button and have it pop up a
search window to type into to locate text or numbers??? I have been told that
it is impossible, but I think it can be done. Please help. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Button to allow a search

Private Sub Commandbutton1_Click()
application.Dialogs(xlDialogFormulaFind).show
End Sub


may be what you want.

--
Regards,
Tom Ogilvy

"Fred" wrote in message
...
I would like to be able to click on a command button and have it pop up a
search window to type into to locate text or numbers??? I have been told

that
it is impossible, but I think it can be done. Please help. Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Button to allow a search

Thank you!! Works great!!

"Tom Ogilvy" wrote:

Private Sub Commandbutton1_Click()
application.Dialogs(xlDialogFormulaFind).show
End Sub


may be what you want.

--
Regards,
Tom Ogilvy

"Fred" wrote in message
...
I would like to be able to click on a command button and have it pop up a
search window to type into to locate text or numbers??? I have been told

that
it is impossible, but I think it can be done. Please help. Thanks




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 195
Default Button to allow a search

Tom Ogilvy wrote

Private Sub Commandbutton1_Click()
application.Dialogs(xlDialogFormulaFind).show
End Sub


Questions:
1. Is the button from the Forms or Control Toolbox?
2. How to assign a Private Sub()?
3. Will it actually find anything without a range selected?

--
David
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Button to allow a search

1)
in the example, it is the click event for a commandbutton from the control
toolbox toolbar. The commandbutton's name is Commandbutton1.

2) this question is meaningless in this context. Since it is an event of
the commandbutton, it is already linked to that button. For buttons from
the forms toolbar, you would just type in the macro name in the assignment
box, even though it can't be selected from the list. Such code should be in
a general module in that case.

3) It will search within the area selected when the button is pressed. This
behavior is different from what is expected if only one cell is selected.

If a specific area is to be searched, it could be set as part of the code.

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

--
Regards,
Tom Ogilvy


"David" wrote in message
...
Tom Ogilvy wrote

Private Sub Commandbutton1_Click()
application.Dialogs(xlDialogFormulaFind).show
End Sub


Questions:
1. Is the button from the Forms or Control Toolbox?
2. How to assign a Private Sub()?
3. Will it actually find anything without a range selected?

--
David





Reply
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
VBA code for search button Dylan @ UAFC[_2_] Excel Worksheet Functions 3 November 25th 08 10:59 PM
how to make search button in the first sheet ghost Excel Discussion (Misc queries) 0 July 28th 07 07:20 AM
Search Button mica Excel Discussion (Misc queries) 2 March 9th 06 11:26 PM
Search Box & Button for Workbook Brian Excel Programming 0 May 6th 04 05:01 PM
Command button to search column Al[_7_] Excel Programming 2 September 9th 03 02:15 PM


All times are GMT +1. The time now is 06:57 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"