Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Getting Excel Find to Default to Searching Workbook not Sheet

hi

I wanted to write a small autorun procedure to make the Find option to start
with assuming the whole workbook should be searched (rather than just the
sheet). However the syntax for the VBA does not include that argument
seemingly:
Cells.Find(What:="national i", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

Is there a workaround or alternative method?

Many thanks

Tim

PS I know there is an excellent FlexFind utility but I don't load any
add-ins unless I have to.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Getting Excel Find to Default to Searching Workbook not Sheet

Tim,

The only workaround that I'm aware of outside of add-ins or complex find macros is to use SendKeys. It is not ideal, as this method is not very consistent. Still, using Excel 2010 with the following code in my ThisWorkbook module successfully set the Find option to Within Workbook. Note that if it does not work for you, you may need to note each keystroke that you use to perform the task and adjust the macro accordingly.

Ben

Private Sub Workbook_Open()
Application.SendKeys ("^f{tab}{enter}{tab}{tab}{down}{down}{tab}{tab}{t ab}{tab}{tab}{tab}{tab}{tab}{enter}")
End Sub
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Getting Excel Find to Default to Searching Workbook not Sheet

Hi Ben

Thanks for getting back with a solution. Have incorporated it and it is
working fine

Am grateful for your help

Tim

"Ben McClave" wrote in message
...
Tim,

The only workaround that I'm aware of outside of add-ins or complex find
macros is to use SendKeys. It is not ideal, as this method is not very
consistent. Still, using Excel 2010 with the following code in my
ThisWorkbook module successfully set the Find option to Within Workbook.
Note that if it does not work for you, you may need to note each keystroke
that you use to perform the task and adjust the macro accordingly.

Ben

Private Sub Workbook_Open()
Application.SendKeys
("^f{tab}{enter}{tab}{tab}{down}{down}{tab}{tab}{t ab}{tab}{tab}{tab}{tab}{tab}{enter}")
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Getting Excel Find to Default to Searching Workbook not Sheet

Tim,

I'm happy to help and glad to hear that it works for you. Thanks for the feedback.

Ben
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
Set the Find and Replace, Options, 'Within' default to Workbook Paffer Excel Discussion (Misc queries) 1 September 10th 09 01:05 PM
how do I set up preferences for a workbook/sheet by default? WiFiMike2006 Excel Discussion (Misc queries) 2 January 18th 07 11:16 PM
How do I make the default FindWithinWorkbook in Excel? ISLHELPDESK Excel Discussion (Misc queries) 4 March 2nd 06 08:09 PM
changing the default type of searching in the find function Jose Roberto Excel Discussion (Misc queries) 1 November 29th 05 12:51 AM
EXCEL: Find data in worksheet and create a new sheet in same workbook Peacce Dog Excel Programming 3 November 18th 04 08:05 PM


All times are GMT +1. The time now is 05:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"