+ Reply to Thread
Results 1 to 6 of 6

Excel .Find Function

  1. #1
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Excel .Find Function

    Is it possible to cycle through column E on a workbook, and search for a String (an auto part name) and each time the autopart is found copy the entire row to a new worksheet?

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Excel .Find Function

    Hi, jo15765,

    the answer to your question is: yes, use Find and FindNext.

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Excel .Find Function

    Beautiful! Would I be able to search a 2nd workbook also? So 1st search PartsInStock.xls then search PartsToBeOrdered.xls

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Excel .Find Function

    Yes, this is only searching in Column "E". You can change this bit in to multi range and multi work sheets.

  5. #5
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Excel .Find Function

    Quote Originally Posted by AB33 View Post
    Yes, this is only searching in Column "E". You can change this bit in to multi range and multi work sheets.
    How would multi workbook/multi worksheets coding look? I googled it but didn't find any relevant results. I was thinking maybe create an array of workbooks to check, and create a For loop with those workbooks, but not sure if that would fit in this scenario.

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Excel .Find Function

    Hi, jo15765,

    why didnīt you put that in the opening post as well?

    You can either hardocde this (so have a copy of the search right under the original one). Only thing to mind is that the Exit Sub in the first loop should be altered to be a jump mark for the entering of the second loop. Iīd preferred to have the code inside the workbook where the rows are to be copied (you didnīt mention that in your post up till now).

    I assumed there is one workbook to collect data on the active sheet. Both other workbook are to be found in the same folder as the workbook with code, if not please amend Drive and Folder to the workbook name.

    This code will call the procedure:
    Please Login or Register  to view this content.
    And this is what is called from above:
    Please Login or Register  to view this content.
    Ciao,
    Holger

+ 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