How to Create an Excel Button to Open the Find Dialog via VBA
Question details
The user wants to create a clickable worksheet button that opens Excel's built-in Find dialog using a VBA macro.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Creating custom UI elements to access native Excel features when the standard ribbon is hidden or unavailable to end-users.
- Observed behavior
- Needs the correct VBA syntax and step-by-step method to link the native Find dialog trigger to a form control or shape.
Ensure that the Developer tab is enabled in your ribbon settings so you can easily access the Visual Basic Editor and insert Form Controls.
Use VBA to Call the Built-in Find Dialog
Write a one-line VBA script to trigger Excel's native Find dialog and assign it to a custom shape or button.
This method gives users a direct interface to trigger the search function without relying on keyboard shortcuts or the top ribbon.
Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor.
In the top menu, click Insert and select Module. This creates a new blank script window.
Type or paste the following code into the module window: Sub OpenFindDialog() Application.Dialogs(xlDialogFormulaFind).Show End Sub
Close the VBA editor. Go to the Insert tab on your ribbon, choose Shapes, and draw a rectangle (or select Insert > Form Controls > Button from the Developer tab).
Right-click the shape or button you just created, click Assign Macro, select OpenFindDialog from the list, and click OK.

Create Macro Buttons Easily with WPS Spreadsheet
WPS Spreadsheet fully supports VBA macros, allowing you to create custom buttons, automate tasks, and call built-in dialogs seamlessly just like Microsoft Excel.
- 1. Open Developer Tools: Launch WPS Spreadsheet, open your file, and navigate to the Developer tab.
- 2. Write Your VBA Code: Click 'Visual Basic' or press Alt + F11 to open the editor, insert a module, and write your Find Dialog script.
- 3. Insert a Custom Button: Go to the Insert tab, select Shapes, and draw a shape on your spreadsheet to act as your button.
- 4. Assign the Macro: Right-click the shape, select Assign Macro, pick your script, and save the file in .xlsm format.

Frequently Asked Questions
Why doesn't my macro button work after closing and reopening the file?
This usually happens if the file was saved as a standard Excel Workbook (.xlsx). Standard workbooks strip out macros for security reasons. You must save the file via 'Save As' and choose Excel Macro-Enabled Workbook (.xlsm).
Can I open the Replace dialog instead of the Find dialog?
Yes, you can easily modify the VBA code to open the Replace dialog instead. Change the code to use Application.Dialogs(xlDialogFormulaReplace).Show.
Why is the Developer tab missing from my Excel ribbon?
By default, Microsoft Excel hides the Developer tab. To enable it, go to File > Options > Customize Ribbon, and check the box next to 'Developer' in the right-hand pane.
Is it possible to use a keyboard shortcut instead of a button?
Yes. While Excel has a built-in shortcut for Find (Ctrl + F), you can assign a custom shortcut to your macro. Press Alt + F8 to open the Macro dialog, select your macro, click Options, and assign a shortcut key.




