+ Reply to Thread
Results 1 to 8 of 8

Copying entire rows of data if a cell meets certain criteria

  1. #1
    Registered User
    Join Date
    11-21-2011
    Location
    Bloomington, IN
    MS-Off Ver
    Excel 2003
    Posts
    13

    Copying entire rows of data if a cell meets certain criteria

    I need to create an excel macro that searches through a document and if a cell in column A matches a certain name, for example "Name1" then I need it to put the corresponding row into sheet 2. There will be multiple rows that match this criteria. I also need it search column A and anything with "Name2" put that in Sheet3, and so on...

    There are approximately 11 different values that I need the macro to do this for, and copy all the corresponding rows into the appropriate sheet. I would greatly appreciate any assistance that anyone can offer.

    Thank you.

  2. #2
    Valued Forum Contributor
    Join Date
    03-20-2011
    Location
    UK
    MS-Off Ver
    Excel 2007/10/16
    Posts
    840

    Re: Copying entire rows of data if a cell meets certain criteria

    Something like this?

    Click attachment

    Click view/Macros/view Macros/Run
    Attached Files Attached Files
    Last edited by micope21; 05-08-2012 at 04:45 PM.
    To help you by my post? it would be nice to click on to say "Thank you".
    If you are happy with a solution to your problem?
    Click Thread Tools above your first post,
    select "Mark your thread as Solved".

  3. #3
    Registered User
    Join Date
    11-21-2011
    Location
    Bloomington, IN
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Copying entire rows of data if a cell meets certain criteria

    This is incredible. Just exactly what I needed. Thank you so much!

  4. #4
    Valued Forum Contributor
    Join Date
    03-20-2011
    Location
    UK
    MS-Off Ver
    Excel 2007/10/16
    Posts
    840

    Re: Copying entire rows of data if a cell meets certain criteria

    You welcome!

    Cheers

  5. #5
    Registered User
    Join Date
    11-21-2011
    Location
    Bloomington, IN
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Copying entire rows of data if a cell meets certain criteria

    Quick update question:

    Is it possible to make the macro update the values instead of copying them twice if I run it twice? For instance in your spreadsheet, what if the dollar amounts changed and I wanted to update all the other sheets. If I run it twice it simply copies them again.

    Thank you!

  6. #6
    Valued Forum Contributor
    Join Date
    03-20-2011
    Location
    UK
    MS-Off Ver
    Excel 2007/10/16
    Posts
    840

    Re: Copying entire rows of data if a cell meets certain criteria

    Hi

    I'm only simple Vba. I would not know how to solved that. I only starting to learn 2 month ago. Long way to go lol.

    There is other workbook does in formula instead vba.

    here a attachment.

    You work on Master. You see 4 Name tab.

    If new name. just click right on tab see move or copy click name1 and tick create a copy.
    click on tab and change new name match master sheet then on B1 with highlight yellow cell same again change name. that it will come on automatic.

    Master sheet up to 1000 row. If need more copy on A to P column and row 1000 carry on till where you want it.

    Name 1 to 4 up to row 600.

    let me know what you think?
    Attached Files Attached Files
    Last edited by micope21; 05-08-2012 at 06:05 PM.

  7. #7
    Registered User
    Join Date
    11-21-2011
    Location
    Bloomington, IN
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Copying entire rows of data if a cell meets certain criteria

    LOVING! Thanks yet again!

  8. #8
    Registered User
    Join Date
    04-02-2016
    Location
    egypt
    MS-Off Ver
    2010
    Posts
    8

    Re: Copying entire rows of data if a cell meets certain criteria

    i have something different coul dyou please help me

    i have a full 2 month dates in row A and i have a numbers at the rest of rows (b,c,d, etc) and i need to write in column B and c the dates from - to ( 07.04.16 to 11.04.16) if i have number 3 in the other rows

    name----from date---- to date-----07.04.16----08.04.16----09.04.16----10.04.16----11.04.16----12.04.16----13.04.16
    jac------------------------------------3-----------3-----------3------------3----------2-----------5-----------7
    ali-------------------------------------5-----------3-----------3------------3----------2-----------5-----------7
    joe------------------------------------3-----------3-----------5------------3----------3-----------3-----------3

    results should be

    name----from date---- to date-----07.04.16----08.04.16----09.04.16----10.04.16----11.04.16----12.04.16----13.04.16
    jac------07.04.16-----10.04.16---------3-----------3-----------3------------3----------2-----------5-----------7
    ali-------08.04.16-----10.04.16---------5-----------3-----------3------------3----------2-----------5-----------7
    joe-------------------------3-----------3-----------5------------3----------3-----------3-----------3-----------5

    in the last row i need to have 4 columns (can i do this or not)


    thanks in advance for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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