+ Reply to Thread
Results 1 to 16 of 16

Search entire sheet for text

Hybrid View

  1. #1
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,085

    Re: Search entire sheet for text

    See next code for the first run
    a "x" is added in column "C" when exists
    It takes time ...so to count will take really longer
    
    
    Option Explicit
    
    Sub Check()
    Const InWsName = "List"
    Const DataWsName = "Data"
    Dim Rg As Range
    Dim WV As String
    Dim F
    
         For Each Rg In Range(Sheets(InWsName).Cells(1, 2), Sheets(InWsName).Cells(Rows.Count, 2).End(3))
            Rg(1, 2) = ""
            WV = Trim(Rg)
            With Sheets(DataWsName)
                Set F = .Cells.Find(What:=WV, After:=.Cells(1, 1), LookIn:=xlFormulas, _
                        LookAt:=xlPart, SearchDirection:=xlNext, MatchCase:=False)
            End With
            If (Not F Is Nothing) Then Rg(1, 2) = "x"
        Next Rg
        MsgBox ("Job Done")
    End Sub
    Last edited by PCI; 07-18-2018 at 05:23 PM. Reason: Statement "For Each" updated
    - Battle without fear gives no glory - Just try

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to search sheet 1 for value and insert entire row from sheet 2
    By mtlong88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-09-2011, 01:21 PM

Tags for this Thread

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