+ Reply to Thread
Results 1 to 11 of 11

how to find a STRING in a worksheet and select the cell containing it.

Hybrid View

  1. #1
    Forum Contributor excelkeechak's Avatar
    Join Date
    07-21-2008
    Location
    India.
    MS-Off Ver
    2013 /2016
    Posts
    363

    how to find a STRING in a worksheet and select the cell containing it.

    I want to know how to find certain String and select the cell it on finding the String.
    Last edited by VBA Noob; 03-28-2009 at 08:35 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485

    Re: how to find a STRING in a worksheet and select the cell containing it.

    Have a look at the FIND function
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor excelkeechak's Avatar
    Join Date
    07-21-2008
    Location
    India.
    MS-Off Ver
    2013 /2016
    Posts
    363

    Re: how to find a STRING in a worksheet and select the cell containing it.

    Its ok. but i want vba code for looping it Through the sheet.Find the string. copy it and paste it.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485

    Re: how to find a STRING in a worksheet and select the cell containing it.

    This is direct from the help on Find in VBA
    With Worksheets(1).Range("a1:a500")
        Set c = .Find(2, lookin:=xlValues)
        If Not c Is Nothing Then
            firstAddress = c.Address
            Do
                c.Value = 5
                Set c = .FindNext(c)
            Loop While Not c Is Nothing And c.Address <> firstAddress
        End If
    End With

  5. #5
    Forum Contributor excelkeechak's Avatar
    Join Date
    07-21-2008
    Location
    India.
    MS-Off Ver
    2013 /2016
    Posts
    363

    Re: how to find a STRING in a worksheet and select the cell containing it.

    HUH, i had seen the code in the excel help file but i m unable to understand it properly i want clear cut code

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485

    Re: how to find a STRING in a worksheet and select the cell containing it.

    What bit don't you understand?

    If you want more detail then perhaps you can provide us with more detail.

+ Reply to Thread

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