+ Reply to Thread
Results 1 to 5 of 5

Search a string and make a worksheet with the searched name will rows

  1. #1
    Registered User
    Join Date
    12-16-2014
    Location
    Bermuda
    MS-Off Ver
    2010
    Posts
    5

    Search a string and make a worksheet with the searched name will rows

    My requirements are simple. I have a huge worksheet with hundreds of rows and columns. I need to search a string or a part-of-the string, copy all rows which contain that part-of-string to a new worksheet and name the worksheet as the name of the string or sub-string.
    I tried the following code:
    Please Login or Register  to view this content.
    The code works in excel 2010 but does not work in 2007. And it does not work for parts of string.
    My columns are like this_midas_2050, that_midas_2040 etc.
    I need to seach for midas in the worksheet and create a worksheet named midas.
    Thanks a lot in advance
    Last edited by purvamitra; 03-22-2015 at 10:02 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,474

    Re: Search a string and make a worksheet with the searched name will rows

    You can edit your post and add code tags, like the example shows,


    AA CodeTags.jpg

  3. #3
    Registered User
    Join Date
    12-16-2014
    Location
    Bermuda
    MS-Off Ver
    2010
    Posts
    5

    Re: Search a string and make a worksheet with the searched name will rows

    Thanks a lot to guru davesexecl. Done as suggested.. nice.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,474

    Re: Search a string and make a worksheet with the searched name will rows

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

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

    View Pic

  5. #5
    Registered User
    Join Date
    12-16-2014
    Location
    Bermuda
    MS-Off Ver
    2010
    Posts
    5

    Re: Search a string and make a worksheet with the searched name will rows

    After correcting my error for copying range, it works now. Thank you very much. It will be nice if some guru here advices how to optimize this hatched up code.
    Attached Files Attached Files

+ 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] Macro to search all sheets and return corresponding rows of searched value
    By amar05 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-19-2013, 01:56 AM
  3. make searched at combobox
    By bskaa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2013, 09:13 AM
  4. [SOLVED] Macro to search a string, then search above for another one and copy the rows between them
    By DarKDjinni in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-20-2012, 09:36 PM
  5. Filtering rows in a column based on a string value search in excel worksheet.
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-06-2012, 01:58 PM

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