+ Reply to Thread
Results 1 to 3 of 3

VBA to convert person-to-event into person-person

  1. #1
    Registered User
    Join Date
    12-21-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    VBA to convert person-to-event into person-person

    Hello Excel gurus!

    I have some data that I've collected that I am trying to transform, and I can't seem to figure it out. Any help is greatly appreciated!

    Background:
    The data that I've collected is based on the people who attend certain events. There is a line, or record, for each individual who attends an event, with a unique code for each individual and for each event. Multiple people can attend the same event, and the same people can attend multiple events.

    Directed Outcome:
    I would like to create a VBA to transform the data (I've got a lot of this type of data) to have two people linked if they attended an event together. I would also like a count for each pair of people representing how many events these two people attended together.

    I've attached a workbook with an example. I've tried everything I know with Pivot Tables and VLOOKUP, but haven't been able to get anywhere. As I mentioned, I have a lot of data formatted in this same way, so I would really love an automated solution to transform the people-to-event relations to people-to-people relations.

    Hopefully this isn't too confusing! Thank you for your time!

    --Curtis

    people-to-event.xlsx

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: VBA to convert person-to-event into person-person

    Try this:-
    It a bit basic at the moment , need cleaning up( putting in an array).
    The code first fills Column "D" on sheet "current format", then uses this data to fill sheet "desired format" , Column "D" on.
    See if its what you want !!!!
    Please Login or Register  to view this content.
    Regards Mick
    Last edited by MickG; 05-07-2014 at 01:59 PM.

  3. #3
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: VBA to convert person-to-event into person-person

    I think this will be close to what you want. Be aware that since the same names appear in column A as in column B in the output sheet, there will be duplicate results. For example, if Person A and Person X both attended Event 1, you would get

    Person A | Person X | 1
    Person X | Person A | 1

    I didn't know if that was ok or not, so I left it.

    Please Login or Register  to view this content.
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

+ 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. A way to send file to certain person, depending on person saving?
    By shiftyspina in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2014, 12:13 PM
  2. Transpose/Pivot multiple rows per person into 1 row per person with fixed columns
    By MaestroEnrique in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2013, 06:35 AM
  3. Autofill a form - (complicated) Based on person, type of event
    By aequitas19 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-15-2012, 10:59 AM
  4. same person, different dates...need the latest date from every person
    By Tanisman in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-26-2011, 07:16 AM
  5. Replies: 3
    Last Post: 02-27-2007, 05:27 AM

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