+ Reply to Thread
Results 1 to 5 of 5

Search for String and copy resul as rows to new sheet

  1. #1
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Search for String and copy resul as rows to new sheet

    HI I have this code. which works fine. It search for a string word and copy the row into a new sheet.
    I would like to instead of search for the word in the code to have a text box. and just type the word there. And it will search the same way and copy the results into a new sheet. If it could be extended to cover selected worksheets, it will be even better.
    Please havea a look at this code and if some have a suggestion or a finish solution, it would be great.

    Sincerely Abjac
    Here is the code for the one i have which search for a word put into the macro.


    Please Login or Register  to view this content.
    Last edited by Cutter; 07-28-2012 at 11:56 AM. Reason: Added code tags

  2. #2
    Registered User
    Join Date
    07-04-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    54
    Writing this from memory on my phone , but try putting
    Please Login or Register  to view this content.
    at the top, and then
    Please Login or Register  to view this content.
    And then replace "Mail Box" in your InStr command with Searchterm.

    Oh, and its a good idea to put [CODE] tags on your posts, it makes it easier to read.

    If it works, please click the star in the bottom left corner
    Last edited by Authentik8; 07-28-2012 at 07:20 AM.

  3. #3
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Search for String and copy resul as rows to new sheet

    HI Tried what you say, and the box "Please input a seach term" popped up.
    I can input a word there but it dont copy anything into sheet 2.
    Even if i input the word as before Mail Box
    But it come up with the message " All Matching Data have been copied"

    But nothing is copied

    So i guess there is missing something, and also that the code for the message box is wrong. would be good to have some like "No match found in sheet" and then also that it dont try copy then.

    This is my code now as you suggested.

    Please Login or Register  to view this content.
    Last edited by Cutter; 07-28-2012 at 11:57 AM. Reason: Added code tags

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Search for String and copy resul as rows to new sheet

    @ abjac

    Welcome to the forum.

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at top of the page and read Rule #3.
    Thanks.

  5. #5
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Search for String and copy resul as rows to new sheet. Nearly Solved

    HI I found this solution and it work with the option box. The only thing to make it perfect is to have a less sensitive search. As in below code i have to type the word totally correctly. But would like to have the same possibility, as when i do it with control F. . Any suggestions to that would be highly appreciated. The last i miss to be able to use this. Please have a look at the code below

    Thanks in advance

    Sincerly abjac

    Please Login or Register  to view this content.
    Last edited by Cutter; 07-28-2012 at 03:13 PM. Reason: Removed code tags

+ 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