Results 1 to 6 of 6

Finding several occurrences of a text in a column using FindNext

Threaded View

  1. #1
    Registered User
    Join Date
    10-07-2011
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    68

    Finding several occurrences of a text in a column using FindNext

    Hello,
    I'm trying to find several occurrences of a text ("Yes") in a column as I would need the row values for each occurence. I'm using FindNext but the first occurrence is getting repeated. Could anyone help me to let only one istance of the occurence of "Yes" in col. G. Below are the code and the file.

    Sub findtest()
    
    Worksheets("ValueArea").Select
    Dim rngFound As Range
    Set rngFound = Range("G:G").Find(What:="Yes", LookIn:=xlValues, LookAt:=xlWhole)
    If Not rngFound Is Nothing Then
        firstaddress = rngFound.Address
        MsgBox firstaddress
    
    
    Do
        Set rngFound = Range("G:G").FindNext(rngFound)
        MsgBox rngFound.Address
        Loop Until rngFound.Address = firstaddress
    
    End If
    
    End Sub


    Thanks in advance.
    Attached Files Attached Files
    Last edited by realdemigod; 10-23-2016 at 07:56 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Counting the number of occurrences of specific text in a column
    By oneeasygeezer in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-23-2015, 11:11 AM
  2. [SOLVED] Counting text occurrences in a column
    By KaiserD2 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-17-2014, 09:13 AM
  3. [SOLVED] Use Countif and ?? to count occurrences of text string in a column
    By CWatsonJr in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-23-2014, 03:08 PM
  4. Finding multiple occurrences in a string
    By Julie_Heyes in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 11-01-2012, 03:27 PM
  5. Finding all occurrences of a pattern within a column
    By matcapir in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 10-05-2011, 11:16 AM
  6. Finding # of Occurrences in various cells.
    By The Exceller in forum Excel General
    Replies: 6
    Last Post: 08-13-2010, 10:02 AM
  7. find value in column with FindNext
    By nono in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2010, 04:35 PM

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