+ Reply to Thread
Results 1 to 7 of 7

Search for string help

  1. #1
    Registered User
    Join Date
    03-31-2015
    Location
    Seattle, WA
    MS-Off Ver
    2007
    Posts
    2

    Search for string help

    I am trying to get this macro to search through column A to find all entries with a certain name (user input) and then copying and pasting each matching row to a different sheet in the work book. Here is what I have so far:

    Please Login or Register  to view this content.
    This seems to do what I am intending, however, it only returns the very first match and does not search throughout the entire column. The sheet with the data is named "Table" and the sheet I am copying too is "Summary." Any help would be much appreciated!

    Here is an example of the data I am using:
    Tyler Barto 5 8. 7.50 .50 .50 7. 6.50 0 1326 0 222 1296. 521 204.00 80.
    Jake Parker 6 5. 1.70 .50 .50 4. .70 0 264 0 0 274. 137 377. 196. 61.
    Rob Carlton 7 5. 4. .50 .50 4. 3. 0 885 0 248 859.3 0 290 271. 89.
    Last edited by tschroder; 03-31-2015 at 04:22 PM.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Search for string help

    Please Login or Register  to view this content.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,379

    Re: Search for string help

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here


    I also rewrote your code:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,985

    Re: Search for string help

    how about a different method. Instead of cycling through records, copying and pasting rows, simply filter the data to the desired results and paste the lot into the other sheet.

    Please Login or Register  to view this content.
    If someone has helped you then please add to their Reputation

  5. #5
    Registered User
    Join Date
    03-31-2015
    Location
    Seattle, WA
    MS-Off Ver
    2007
    Posts
    2

    Re: Search for string help

    xladept- received a invalid qualifier on this line:
    Please Login or Register  to view this content.
    PJ- I am presenting this data to some who are not proficient in Excel so I want it as user
    friendly as possible (click a couple of buttons, type a name and results). Also data is added to this work book daily so I think this is a much easier way to manage it. Your code worked perfectly thank you!

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,379

    Re: Search for string help

    Try:

    Please Login or Register  to view this content.
    and if that doesn't work maybe you could:

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,379

    Re: Search for string help

    Oops! wrong thread

+ 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. Replies: 1
    Last Post: 09-11-2014, 10:59 AM
  2. [SOLVED] Vlookup, Match (Search or Find) partial string within string in a Cell
    By dluhut in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-28-2013, 12:40 PM
  3. Replies: 1
    Last Post: 09-20-2012, 03:22 PM
  4. [SOLVED] Search for string across header row, then search for another string down found column
    By TucsonJack in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-14-2012, 02:09 PM
  5. search a string withing a string : find / search hangs
    By itarnak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-24-2005, 11:05 AM

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