+ Reply to Thread
Results 1 to 8 of 8

Retrieving value from another sheet based on column

  1. #1
    Registered User
    Join Date
    06-06-2011
    Location
    NC
    MS-Off Ver
    Excel 2011
    Posts
    10

    Retrieving value from another sheet based on column

    Hello guys,

    I've been working on a macro (with the help from this forum) that condenses data from multiple ranges to a new sheet. I'm almost done with the macro but I'm stuck on this one final part.

    I've attached an example but I'll explain the scenario.

    The raw datasets are in ranges that are 3 columns wide.
    the macro so far lists all the unique instances in the first sheet into one range.
    What I'm having trouble with is grabbing the counts from the ranges in sheet 1 to the condensed range.

    Can anyone point me in the right direction??

    Also, if anyone wants the macro I have so far, I would be glad to share it.
    Attached Files Attached Files
    Last edited by kookymonster; 06-24-2011 at 03:00 PM.

  2. #2
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Retrieving value from another sheet based on column

    kookymonster

    Would you mind re-attaching the workbook with the code. It probably could be modified to do what you want.
    Charles

    There are other ways to do this, this is but 1 !
    Be Sure you thank those who helped.
    IF YOU'RE SATISFIED BY ANY MEMBERS RESPONSE TO YOUR ISSUE PLEASE USE THE STAR ICON AT THE BOTTOM LEFT OF THE POST UNDER THEIR NAME.

  3. #3
    Registered User
    Join Date
    06-06-2011
    Location
    NC
    MS-Off Ver
    Excel 2011
    Posts
    10

    Re: Retrieving value from another sheet based on column

    Thanks for taking the time to take a look.

    This is the code I have so far. Everything up to
    " 'Gets counts from sheet 1" works. After that, i've just been trying out different things with no success

    Please Login or Register  to view this content.
    Last edited by kookymonster; 06-21-2011 at 03:52 PM.

  4. #4
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: Retrieving value from another sheet based on column

    Here is one way to move your data?

    Please Login or Register  to view this content.
    ...
    Thank You, Mike

    Some Helpful Hints:

    1. New members please read & follow the Forum Rules
    2. Use Code Tags...Place[code]Before the first line and[/code] After the last line.
    3. If you are pleased with a solution mark your post SOLVED.
    4. Thank those who have help you by clicking the scales at the top right of the post.

    Here...

  5. #5
    Registered User
    Join Date
    06-06-2011
    Location
    NC
    MS-Off Ver
    Excel 2011
    Posts
    10

    Re: Retrieving value from another sheet based on column

    realniceguy,

    Thanks for the code, I've tried it but it doesn't seems to work.
    It hangs up excel for a really long time.
    Do you have any ideas why that might be?

  6. #6
    Registered User
    Join Date
    06-06-2011
    Location
    NC
    MS-Off Ver
    Excel 2011
    Posts
    10

    Re: Retrieving value from another sheet based on column

    Realniceguy,

    I tested your code again after tweaking my ws a little bit and it works perfectly!
    However, i saw it only works for 3 ranges. In reality, I can have up to 28 ranges where I must retrieve information from. Is there a way to make it into a loop can could support x amount of ranges?

    Thanks,

  7. #7
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: Retrieving value from another sheet based on column

    Here you go,

    I attached a workbook so you can see how it works. This code will loop through any amount of ranges you have in your workbook and transfer the data.

    You may have to fiddle with the sheet names a bit I have them set as
    Sheets(1) 'Get Counts
    Sheets(2) 'Moving Counts

    I also noticed you have another version of excel so you may need to edit the .row and .columns because your verson has more rows and columns than mine.


    Here is the code:

    Please Login or Register  to view this content.
    ...

    Hope it helps ,Post back any issues.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    06-06-2011
    Location
    NC
    MS-Off Ver
    Excel 2011
    Posts
    10

    Re: Retrieving value from another sheet based on column

    Thank you so much! It's awesome that you take your free time to help others!

+ 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