Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

how to find the data in between the sheets?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Junaid - 30 May 2008 14:35 GMT
Hi All,

I have a doubt, i have 25 sheets in the workbook in that i want to find the
data among the sheets, the data which i want to find, that will be in the 26
sheet (A1).

Thanks in advance!
Norman Jones - 30 May 2008 15:17 GMT
Hi Junaid,

In a standard module, try something
like:

'==========>>
Public Sub Tester()
   Dim WB As Workbook
   Dim SH As Worksheet
   Dim SH2 As Worksheet
   Dim Rng As Range
   Dim sStr As String

   Set WB = Workbooks("myBook.xls")     '<<==== CHANGE
   Set SH2 = WB.Sheets("Sheet26")           '<<==== CHANGE

   sStr = SH2.Range("A1").Value

   For Each SH In WB.Worksheets
       On Error Resume Next
       With SH
           If .Name <> SH2.Name Then
               Set Rng = .Cells.Find _
                         (What:=sStr, _
                          After:=.Range("A1"), _
                          LookIn:=xlFormulas, _
                          LookAt:=xlWhole, _
                          Searchorder:=xlByRows, _
                          MatchCase:=False)
           End If
       End With
       On Error GoTo 0
       If Not Rng Is Nothing Then
           Exit For
       End If
   Next SH

   If Not Rng Is Nothing Then
       MsgBox "The value  " & sStr _
            & " has found at " _
            & Rng.Address(External:=True)
   Else
       MsgBox "The value " & sStr _
            & " has not been found"
   End If

End Sub
'<<============

---
Regards.
Norman

> Hi All,
>
[quoted text clipped - 5 lines]
>
> Thanks in advance!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.