+ Reply to Thread
Results 1 to 3 of 3

Macro that consolidate values from cells basing on conditions

  1. #1
    Registered User
    Join Date
    12-09-2014
    Location
    Poland
    MS-Off Ver
    2010
    Posts
    3

    Macro that consolidate values from cells basing on conditions

    Hello !

    I would like to ask for support in creating simple macro that would actually do few things:

    1. We have two columns Employee Class and Employee name.

    -In (Sheet1) Basing on "employee class" column, every employee got his class i would like to get all the records from "employee name" column that are for example "Class 1" in to desired cell in other sheet that also do have employee class column.

    - In destination cell (Sheet2) there is Class codes column with unique values that are available for company.

    - I need to separate people from Sheet1 to Sheet2 basing on class codes so it would looks like:

    Class code Employee
    62 Tom, Johnny, Melisa

    Is there any way to do that efficiently ?

    Thanks in advance !

  2. #2
    Registered User
    Join Date
    12-09-2014
    Location
    Poland
    MS-Off Ver
    2010
    Posts
    3

    Re: Macro that consolidate values from cells basing on conditions

    Hello Guys,

    Embarrassing, i did managed to simply create Index/match combo.

    Yet it shows me only one, first value, is there any option to modify this to show all values in range with comma as separator ?

    Thanks in advance !

    =INDEX('Employee data'!B:C;MATCH('Job Map 2014'!A5;'Employee data'!B:B;0);2)

  3. #3
    Registered User
    Join Date
    12-09-2014
    Location
    Poland
    MS-Off Ver
    2010
    Posts
    3

    Re: Macro that consolidate values from cells basing on conditions

    Figured it out using this easy fucntion:

    Function MYVLOOKUP(lookupval, lookuprange As Range, indexcol As Long)
    Dim r As Range
    Dim result As String
    result = ""
    For Each r In lookuprange
    If r = lookupval Then
    result = result & ", " & r.Offset(0, indexcol - 1)
    End If
    Next r
    MYVLOOKUP = result
    End Function

+ 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] Macro to get values and consolidate them.
    By Hyflex in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-06-2012, 04:16 PM
  2. Replies: 1
    Last Post: 03-18-2012, 03:20 PM
  3. Count the records basing 2 different cells
    By rahulguha in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-23-2009, 07:10 AM
  4. Replies: 1
    Last Post: 08-20-2009, 10:58 AM
  5. Consolidate values from multiple cells
    By jasonmcbride in forum Excel General
    Replies: 2
    Last Post: 10-28-2008, 06:34 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