+ Reply to Thread
Results 1 to 6 of 6

Search a column for a certain criteria and cut and paste in new sheet.

  1. #1
    Registered User
    Join Date
    11-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    29

    Search a column for a certain criteria and cut and paste in new sheet.

    OK, I'm new to macro's I've did very basic stuff. But now I'm stuck I need a macro that that would continue to loop through a coulmn and if the search finds the criteria it would cut the entire row its in and paste it in a new sheet. If there is like more than two different types I want each different types in a new sheet.

    This is the only Example i could think of.




    bob...1...2...3...4...5
    bob...1...2...3...4...5
    the...1...2...3...4...5
    bob...1...2...3...4...5
    the...1...2...3...4...5
    the...1...2...3...4...5
    and...1...2...3...4...5
    and...1...2...3...4...5
    bob...1...2...3...4...5
    and...1...2...3...4...5



    Say i wanted to filter out anything thats not bob.. the macro would see the, and... the macro would remove them and put them in seperate new sheets
    so sheet 1 would be this


    bob...1...2...3...4...5
    bob...1...2...3...4...5
    bob...1...2...3...4...5

    second sheet
    and...1...2...3...4...5
    and...1...2...3...4...5
    and...1...2...3...4...5

    third sheet
    the...1...2...3...4...5
    the...1...2...3...4...5
    the...1...2...3...4...5


    this is the only way i could explain it. sorry if needs more explaning post back

    thank you

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

    Re: Search a column for a certain criteria and cut and paste in new sheet.

    Attach a sample workbook.

    When you are in Advanced reply, click on the paperclip to open the upload window.

    View Pic

  3. #3
    Registered User
    Join Date
    11-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Search a column for a certain criteria and cut and paste in new sheet.

    example.xlsx

    Well here is the Example in the spreed sheet you'll see 3 different types of vendors, (SYSCO, KEANY, GFS) What I'm trying to do is create a macro that will take this list and search by column E and see Sysco and put that in a new spread sheet, put keany in a new spread sheet put GFS in a new spread sheet. instead of filtering copy and paste so sheet 1 will have all of sysco with column A:O and the samething with Keany and GFS.

  4. #4
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: Search a column for a certain criteria and cut and paste in new sheet.

    try this

    Please Login or Register  to view this content.
    This would run when data was entered in column O. It worked for me in a similar issue so hopefully it will work for you. You could change it so it would run when data was entered in a different cell by if that works better.

  5. #5
    Registered User
    Join Date
    11-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Search a column for a certain criteria and cut and paste in new sheet.

    outcome.xlsxIt worked but it's not what I was looking for I dont want a search box to come up I kinda want the macro to search column E and see that there are different names and cut and paste the different names with the entire row in a new sheet. I attached what I want the outcome to be.

  6. #6
    Registered User
    Join Date
    11-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Search a column for a certain criteria and cut and paste in new sheet.

    Ok so it took me about 3 days to do it but I figured it out on my own it does exactly what I want it to do and I love it. Just shows you what you can do when you want something bad enough

+ 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