Change Settings in Find Dialog Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want a macro that will change the default setting in the Find or Find and
Replace dialog box to search by "columns" instead of rows, and look in
"values" instead of formulas.

I'm glad all of you are there to help people like me.
 
One way:

Put this in the ThisWorkbook code module of your Personal.xls workbook:

Private Sub Workbook_Open()
Worksheets(1).Cells.Find What:=vbNullString, _
LookIn:=xlValues, SearchOrder:=xlByColumns
End Sub

Note that the Find dialog retains the settings of previous finds, so the
new "defaults" won't come up if you do a search by rows and look in
formulas.
 
This is what I have in the Personal Workbook and it does not work for me.
What am I doing wrong?
------------------------------------------------------------------------------
Sub Custom_Find_Dialog()
'
' Custom_Find_Dialog Macro
'

'
Private Sub Workbook_Open()
Worksheets(1).Cells.Find What:=vbNullString, _
LookIn:=xlValues, SearchOrder:=xlByColumns
End Sub
 
You shouldn't have the

Sub Custom_Find_Dialog()

line. In fact, what you've shown *should* give you a compile error.

Make sure that the Workbook_Open() macro is in the ThisWorkbook module,
not a regular code module.
 
JE wrote to put this code:

Private Sub Workbook_Open()
Worksheets(1).Cells.Find What:=vbNullString, _
LookIn:=xlValues, SearchOrder:=xlByColumns
End Sub

behind the ThisWorkbook module in your personal.xls workbook's project.

Don't try to bury it in an existing subroutine (like custom_find_document).

By using Workbook_Open under ThisWorkbook, then the code will run each time
excel opens this file. By using personal.xls (in your XLStart folder), excel
will open that file each time it starts.
 
It works!!! I'm soooo glad for people like you that have the patience and
expertise to help others!!!
 

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

Back
Top