Using macros to open a file with the Find Menu option available

J

jessdaisy

Hi -

I am looking to open a file with the Find function enabled immediately. I
thought I could do this using an auto_open macro, however, the Find dialog
box doesn't appear.

Is there a way I can make the dialog box appear with the macro or is there a
different way to have the Find function open automatically upon opening a
file?

Thanks!
Jessica
 
P

Patrick Molloy

use the workbook's open event ...

Private Sub Workbook_Open()
Application.Dialogs(xlDialogFormulaFind).Show
End Sub

this is in the code behind ThisWorkbook. Are you ok finding that?
 
D

Dave Peterson

I put this in a general module and it seemed to work ok for me:

Option Explicit
Sub auto_open()
Application.Dialogs(xlDialogFormulaFind).Show
End Sub
 
J

jessdaisy

Should I input this in the VB Script?

Patrick Molloy said:
use the workbook's open event ...

Private Sub Workbook_Open()
Application.Dialogs(xlDialogFormulaFind).Show
End Sub

this is in the code behind ThisWorkbook. Are you ok finding that?
 
P

Patrick Molloy

open the VB editor - ALT+F11

then you can use either the AUTO_OPEN or the Workbook Open event
- my code or Dave's is teh same, just in a different place

Mine: in the Project Explorer, expand the VBAProject for your workbook.
Right click on ThisWorkbook & select View code
in the code window , paste in my code

Dave's: Open a standard code module from the menu bar : INSERT / MODULE
(NOT CLASS MODULE!)
and paste in Dave's code.

These both execute when the workbook opens.
 
J

jessdaisy

Thank you Patrick and Dave! I figured it out and it works! Exactly what I
wanted!

:) Have a fantastic day!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top