View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
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