+ Reply to Thread
Results 1 to 11 of 11

Macro to lists all values in a range, and add value of another cell in adjacent cell

  1. #1
    Forum Contributor
    Join Date
    03-18-2013
    Location
    Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    139

    Macro to lists all values in a range, and add value of another cell in adjacent cell

    Hey guys,

    I have a table that has names in column A131:A172
    In B131:F172 - different values, including empty cells.
    I need a macro that lists each value found in B131:F172, and copy them in cells starting from cell B174, as well as list the respective name in cells starting from cell A174. (values can repeat, no need to be unique)

    For example A131 is John. D131 is 5. The macro will put in A174 John and in B174 will put 5.
    Then F131 if it is again 5, to list A175 John, B175 to list 5.
    Then to collect the values from Row 132, 133, etc.

    Is this possible?

    Thank you in advance!
    Last edited by dreddster; 06-04-2015 at 09:11 AM.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to lists all values in a range, and add value of another cell in adjacent cell

    Not sure I understand. If this doesn't help, please provide a before and after sample.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-18-2013
    Location
    Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Macro to lists all values in a range, and add value of another cell in adjacent cell

    Hello John!

    I have attached a sample file, and have listed the first few results how they should appear
    Ef_example6.xlsx

    Macro should go from row 131, column B and whenever it sees a cell that has some text inside, to copy it below and list the name that is in column A.
    I just need a list the values of all tests and the respective name that took it.

    Also I will run the macro from a different sheet so if possible to refer the macro to run on sheet called Test
    Last edited by dreddster; 06-04-2015 at 10:32 AM.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to lists all values in a range, and add value of another cell in adjacent cell

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-18-2013
    Location
    Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Macro to lists all values in a range, and add value of another cell in adjacent cell

    John, it is perfect! Just one more thing. Because I am running it from another worksheet, how do I tell the macro to do that on sheet "Test"?

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to lists all values in a range, and add value of another cell in adjacent cell

    Try:

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    03-18-2013
    Location
    Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Macro to lists all values in a range, and add value of another cell in adjacent cell

    That's strange. I updated it, but it is not working when I run the macro from another worksheet. Otherwise it works fine.

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to lists all values in a range, and add value of another cell in adjacent cell

    It works for me. What do you mean by run the macro from another worksheet? Do you want a worksheet event code? Do you want it operate on the active sheet? Please explain.

  9. #9
    Forum Contributor
    Join Date
    03-18-2013
    Location
    Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Macro to lists all values in a range, and add value of another cell in adjacent cell

    The file has 2 worksheets. One is with the Results, the second one is Data, and will be hidden. On Data will be the actual macro work
    I will put a button on the Results worksheet and assign the macro to it.

    When I open the Results worksheet and run the macro - the screen just blinks once and nothing has been done.
    When I select the Data worksheet, and run the macro, it works fine.

    Let me test it a little further.
    Last edited by dreddster; 06-05-2015 at 08:27 AM.

  10. #10
    Forum Contributor
    Join Date
    03-18-2013
    Location
    Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Macro to lists all values in a range, and add value of another cell in adjacent cell

    I did retype all sheet names again, and in the macros.
    All is good now! I must have typed a cyrillic character in the sheet name.

    Thank you so much for your help!

  11. #11
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to lists all values in a range, and add value of another cell in adjacent cell

    You're welcome. Glad to help out and thanks for the feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Run macro and adjust the column width range A:Y
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-03-2014, 12:16 PM
  2. Validation Lists - Multiple dependent lists with unique values
    By Lewigi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2013, 06:42 AM
  3. LISTS! identifying unique values in multiple lists
    By pwall1115 in forum Excel General
    Replies: 3
    Last Post: 04-09-2013, 03:36 AM
  4. Replies: 3
    Last Post: 09-20-2011, 05:05 PM
  5. [SOLVED] Unique Values Between Two Multi-Column Lists.
    By Intern Ian in forum Excel General
    Replies: 0
    Last Post: 11-09-2005, 05:10 PM

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