+ Reply to Thread
Results 1 to 5 of 5

Search specific column and then copy to new sheet

  1. #1
    Registered User
    Join Date
    10-24-2010
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Arrow Search specific column and then copy to new sheet

    Hello again,

    I need a way so that I can press a button and then a box will appear and allow me to type a search word. It will then scan a particular column if it contains that word and then it will copy the entire row and paste it into a new sheet.

    It must be able to handle multiple search terms.

    So: If I have multiple names like "John Smith" and then 20 rows down I have John Smith again and then another 10 times it has John Smith in that column, then it will copy the entire row in which john smith is within, (All of them) and paste them into a new sheet.

    It should copy the entire row including the columns before, because the column where it is searching for will mostly likely not be column A.

    Thank's again

    ~JSN
    Last edited by PowerZ; 10-25-2010 at 10:10 AM.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Search specific column and then copy to new sheet

    Give this a try. You did not specify which column to search in so this code assumes you want to search in the active cell column. This code uses filtering to copy all (exact) occurrences of the search term to Sheet2.

    Please Login or Register  to view this content.
    Last edited by Palmetto; 10-25-2010 at 07:10 AM.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    10-24-2010
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Search specific column and then copy to new sheet

    Okay, That code seems to create a pivot-table, instead of copying the results to a seconds sheet.

    Which actually work's better. So could you just modify that a little bit, and just delete the copying to the second sheet and make it so it will look in the "D" column. Also one last thing, to make a button which would reset the pivot table to show all.

    So that then, you can filter the results, and then see the row, and then reset it back to normal.

    Thank's for the quick response!

    ~JSN

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Search specific column and then copy to new sheet

    The code above DOES NOT create a Pivot Table . As I stated - it applies filtering, which is not the same.

    Code below is revised per your last post to look only in column-D.

    Please Login or Register  to view this content.

    Also one last thing, to make a button which would reset the pivot table to show all.
    You can turn the filter off via the menu. However, here is code which you can use to do this. Just create a button and assign this macro to the button.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-24-2010
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Search specific column and then copy to new sheet

    Thank you for this. Sorry about that, I thought it was a Pivot-Table!

    Thank's for the quick responses and great help!

    ~JSN

+ 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