+ Reply to Thread
Results 1 to 5 of 5

Thread: If one cell has a value, copy adjacent cell's value and paste to different worksheet

  1. #1
    Registered User
    Join Date
    08-22-2011
    Location
    Texas, USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Lightbulb If one cell has a value, copy adjacent cell's value and paste to different worksheet

    So, for example, I have a list of statements in Column B. Column A is basically a checklist. If someone puts an X in column A (to "select" the statement next to it), I'd like the statement next to it (in B) to be copied to the next worksheet. Can someone advise how to do this?

  2. #2
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,640

    Re: If one cell has a value, copy adjacent cell's value and paste to different worksh

    in the other sheet, enter a formula say in B1 to give a count of "X" marked.

    e.g.

    =COUNTIF('Sheet1'!$A$1:$A$100,"X")

    Adjust sheetname and range to suit.

    Then in A2 to extract the values from B.

    =IF(ROWS($A$1:$A1)>$B$1,INDEX('Sheet1'!$B$1:$B$100,SMALL(IF('Sheet1'!$A$1:$A$100="X",ROW('Sheet1'!$A$1:$A$100)-ROW('Sheet1'!$A$1)+1),ROWS($A$1:$A$1))))
    adjust ranges and sheetname to suit, then confirmed with CTRL+SHIFT+ENTER not just ENTER and copy down.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    08-22-2011
    Location
    Texas, USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: If one cell has a value, copy adjacent cell's value and paste to different worksh

    This doesnt exactly answer my question, unless I am misunderstanding the answer.

    Let's imagine a scenario. I am so thrilled with discovering this new forum, that I am throwing a party. Imagine the attendee checklist for this party.

    TAB ONE: Column A are boxes that a "x" can be marked in. Let's pretend the names of 10 people are in Column B, and we are going to select in Column A (by marking an "x") who is to be invited to our party. Its an excel party, so wildness is guaranteed. ;-)

    However, being a woman, I am mad at almost everyone on the list, so just the first 3 names are checked. (I had to include everyone else anyway just to be clear who WASNT invited to my awesome party.) So, now we have a list of 10 names in column B (B1:B10), and a few "x"s (A1:A10 is our range, but only X's in A1:A3).

    TAB TWO: On the next worksheet in cell A1, I have typed: "Party-of-Excel-Frenzy Invitees:" I would like the names of the lucky invitees to appear as a list in cell A2 in this second tab.

    FIRST MARGARITA OF THE PARTY GOES TO THE FIRST PERSON TO POST THE FORMULA!

    DISCLAIMER: No women and/or excel enthusiasts were harmed in the making of this scenario. Please drink responsibly. Booze is not a toy.

  4. #4
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,640

    Re: If one cell has a value, copy adjacent cell's value and paste to different worksh

    I neglected to enter the value-if-true part of the first IF..

    Try:

    =IF(ROWS($A$1:$A1)>$B$1,"",INDEX(Sheet1!$B$1:$B$100,SMALL(IF(Sheet1!$A$1:$A$100="X",ROW(Sheet1!$A$1:$A$100)-ROW(Sheet1!$A$1)+1),ROWS($A$1:$A1))))
    confirmed with CTRL+SHIFT+ENTER not just ENTER and copied down
    Attached Files Attached Files
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  5. #5
    Registered User
    Join Date
    03-14-2012
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: If one cell has a value, copy adjacent cell's value and paste to different worksheet

    This formula works well for me! However, in my scenario, I would like all the names, with commas as a separator, in one cell. Example: Mary, Mark, Jessica, Rita (all in A2)

    Thanks in advance!!!

+ 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.2.0