Results 1 to 2 of 2

vba cells.find problem

Threaded View

jeternyn1 vba cells.find problem 07-24-2007, 04:25 PM
royUK Wrap your code with Code... 07-25-2007, 02:39 AM
  1. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Wrap your code with Code tags, it's much easier to read. See the link at the bottom of my post.

    Option Explicit
    
    Sub searchAllSheets()
        Dim wbSource As Workbook
        Dim ws     As Worksheet
        Dim uRng   As Range
        Dim rCl    As Range
        Dim sAddress As String
        'change this to your workbook
        Set wbSource = Workbooks("Data")
        'check  each worksheet
        For Each ws In wbSource.Worksheets
            'limit search to UsedRange
            Set uRng = ws.UsedRange
            With uRng
                Set rCl = .Find("Node Info: 443", xlValues)
                If Not rCl Is Nothing Then
                    sAddress = rCl.Address
                    Do
                        'do something with cell, Copy or whatever
                        Set rCl = .FindNext(rCl)
                    Loop While Not rCl Is Nothing And rCl.Address <> sAddress
                End If
            End With
        Next ws
    End Sub
    Last edited by royUK; 07-25-2007 at 02:48 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1