Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default search a workbook

Is there a way to write this so it will search the
whole workbook at less 10 worksheets

Sub aaa()
'
WhatToFind = ActiveCell.Value
Cells.Find(What:=WhatToFind, After:=ActiveCell,
LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByColumns,
SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
End Sub

I want to Thank You
Esau
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default search a workbook

Sub aaa()
'
Dim rng as Range, sh as Worksheet
WhatToFind = ActiveCell.Value
for each sh in Workbooks.Worksheets
sh.Activate
set rng = Cells.Find(What:=WhatToFind, _
After:=Range("IV65536"), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
if not rng is nothing then
rng.Select
ans = msgbox( "continue searching? ", vbYesNo)
if ans = vbNo then exit sub
end if
Next
End Sub


"Esau" wrote in message
...
Is there a way to write this so it will search the
whole workbook at less 10 worksheets

Sub aaa()
'
WhatToFind = ActiveCell.Value
Cells.Find(What:=WhatToFind, After:=ActiveCell,
LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByColumns,
SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
End Sub

I want to Thank You
Esau



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
Search Workbook aftamath77 Excel Discussion (Misc queries) 1 May 19th 08 05:28 PM
Search a Workbook jknapp1005 Excel Discussion (Misc queries) 3 January 18th 07 03:27 PM
Search Data from one Workbook and copy it into another Workbook Matz Excel Discussion (Misc queries) 0 August 4th 06 10:45 AM
Search within workbook Mare New Users to Excel 3 October 10th 05 07:17 PM
Search workbook fda secretary Excel Discussion (Misc queries) 2 August 24th 05 07:48 PM


All times are GMT +1. The time now is 03:32 PM.

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

About Us

"It's about Microsoft Excel"