+ Reply to Thread
Results 1 to 4 of 4

Importing Specific Values to New Worksheet

  1. #1
    Registered User
    Join Date
    10-12-2009
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Post Importing Specific Values to New Worksheet

    Hi,

    This is probably a really newbie question, but I'm not even sure where to start. I have an Excel worksheet with a list of many variables under subheadings. Lets call these subheadings A, B, C, D, E and F. These alphabetical subheadings have binary values in a column (either 0 or 1) based on the alphabetical subheading (except for the last column). See Picture for better illustration:

    http://imgur.com/9qDNy.jpg

    Now what I want to do is to be able to essentially copy and paste values that correspond to a certain criteria (I imagine I would need to use an IF command or something similar?) into a separate worksheet. So using the example above lets say I want, for each row:

    1) IF (C=0) AND (E=1) then copy the values in A, B and F, as well as C and E (of that row) into their own row in a new worksheet
    2) IF (C=1) AND (E=0) then copy the values in A, B and F, as well as C and E (of that row)into their own row in a new worksheet
    3) IF (C=1) AND (E=1) then copy the values in A, B and F, as well as C and E (of that row) into their own row in a new worksheet
    4) IF (C=0) AND (E=0) then IGNORE

    So in the above image example, the new worksheets would look like:

    http://imgur.com/t2jwh.jpg

    As you can see, the values that WERE in column D in the original, are nowhere in the new worksheets, and they are sorted according to those criteria. Row 5 is also not included anywhere, as it had C=0 and E=0.

    If anyone can help it would be greatly appreciated.

    b1177

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Importing Specific Values to New Worksheet

    The AUTOFILTER will let you do this quite readily.

    1) on your main sheet...turn on the Data > Filter > Autofilter
    2) Filter column C by 0 and column E by 1
    3) Copy everything you see to your new worksheet, delete column D
    4) Back on the main sheet, set C and E to "showall" again

    5) Now filter column C by 1 and column E by 0
    6) Copy all you see to a new worksheet and delete column D

    7) Change the filter in column E to 1
    8) Copy all you see to a new worksheet and delete column D

    9) On the main sheet, turn off the Autofilter the same way you turned it on
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-12-2009
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Importing Specific Values to New Worksheet

    That worked perfectly! Thank you so much

    b1177

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Importing Specific Values to New Worksheet

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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