+ Reply to Thread
Results 1 to 8 of 8

Search string

  1. #1
    Registered User
    Join Date
    08-11-2014
    Location
    Wellington
    MS-Off Ver
    2013
    Posts
    28

    Question Search string

    I am working on a dataset with about 5000 rows. How can i copy those rows that contain a particular string in any of its cells. and paste them on new workbook.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Search string

    This is simple.

    You should have provided more information, such as the number of columns to select.

    But I will create something to get you started.

    This file looks for "Select" in the whole workbook
    Then selects the entire row and copies it
    It then opens a new workbook and pastes the copied rows.

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 08-11-2014 at 02:50 PM.

  3. #3
    Registered User
    Join Date
    08-11-2014
    Location
    Wellington
    MS-Off Ver
    2013
    Posts
    28

    Re: Search string

    Hi,
    I am novice in excel. Can you please tell me how to use that code. And there are 8 columns (A-H). and the string doesn't have to be an exact match it is okay if its a subset. Thanks you.
    Last edited by avinkris; 08-11-2014 at 03:25 PM.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Search string

    Ok

    I have created a workbook for you.

    Open it, click on developer, then Macros and then run Select_Special.

    The macro works as described above.

    You can edit it by clicking on developer, then Macros and then selecting Select_Special and clicking on edit.

    The macro is quite simple to modify.

    The only variables that you need to consider are:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-11-2014
    Location
    Wellington
    MS-Off Ver
    2013
    Posts
    28

    Re: Search string

    Thank you very much. That was very helpful.

  6. #6
    Registered User
    Join Date
    08-11-2014
    Location
    Wellington
    MS-Off Ver
    2013
    Posts
    28

    Re: Search string

    but what if there is extra text in the cell along with SELECT. For example i want to copy the row even if SELECT is a substring like "aSELECTb" or "a SELECT B" "aSELECT" etc.

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Search string

    replace this line

    Please Login or Register  to view this content.
    with

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-11-2014
    Location
    Wellington
    MS-Off Ver
    2013
    Posts
    28

    Re: Search string

    excellent thankyou.

  9. #9
    Registered User
    Join Date
    08-11-2014
    Location
    Wellington
    MS-Off Ver
    2013
    Posts
    28

    Re: Search string

    hi, the program is stopping at Selection.Copy. when I try to do it manually at this point it says "cannot copy multiple selections."

+ 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. [SOLVED] Search for string and test the character that is found after the string
    By flipjarg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2013, 04:27 PM
  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