Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Find and Display / Modify code

Hi All,

I have several sheets with several columns of data.

I want to search for an item in column A starting from
Fourth sheet until sheet 15 and if the item found then
display in a
message box (which I prefer) or in a new sheet the data
label(for column A,C,F,K,L) and corresponding data (for
selected fields) or proceed to the next sheet until the
item is found. the data never get repeated (In column A)
so there would be only one instance of the data in column
A.

Once the item is found no need to continue search.

If it is not found a message saying not found.

Is it possible to search through sheets which
xlVeryHidden without setting it to be visible?

How could i get this by a macro?

My present code look like this:

Sub TestSearch()

Sheets("Interface").Select
sStr = InputBox("Enter item to search for")
For Each sh In ThisWorkbook.Worksheets
If sStr < "" Then
Set rng = Nothing
sh.Activate
Set rng = sh.Range("B:B").Find(What:=sStr, _
After:=sh.Range("B1"), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
End If
If Not rng Is Nothing Then
MsgBox "found on sheet " & sh.Name & " at cell " &
rng.Address

'Else
Exit Sub
End If


Next
If rng Is Nothing Then
MsgBox sStr & " was Not found"
End If
End Sub


TIA
Soniya
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
Modify code bigmaas Excel Discussion (Misc queries) 2 February 16th 10 10:51 AM
Modify Code Richard Excel Worksheet Functions 0 March 13th 08 08:19 PM
Modify a Formula to Display Blank carl Excel Worksheet Functions 2 July 13th 05 02:22 PM
How to modify VBA code for Add-in? Shetty Excel Programming 1 March 3rd 04 04:04 PM
Modify Find Code Al[_6_] Excel Programming 1 July 15th 03 10:35 PM


All times are GMT +1. The time now is 05:27 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"