I have multiple columns of data listing out employees from different divisions. Each column is a query and will have different numbers of employees and in some cases, the query can return a NULL employee. I need to combine these employees into a single column with the duplicates removed. Here is an example:
I need to combine the employees in columns A thru L into a single list in column M and remove any duplicates. I also need to leave the NULL value if it exists in any of the queries. The resulting list would look like this:
I need VBA to do this as I want this to occur when I open the spreadsheet. I have each of the 12 queries set to run when I open the spreadsheet so they will be populated. I need the VBA to produce a list of unique employees that I can use in another worksheet with getpivotdata formulas to summarize some data on other worksheets.
Thanks in advance for any help with this.
Division1 | Division2 | Division3 | Division4 | Division5 | Division6 | Division7 | Division8 | Division9 | Division10 | Division11 | Division12 |
---|---|---|---|---|---|---|---|---|---|---|---|
BRIAN | DANNY RAY | BOB | BRIAN | JASON | BRIAN | BRIAN | GINA | ||||
DAVE | JASON | DANNY RAY | EDWARD | DANNY RAY | DANNY RAY | ||||||
DANNY RAY | JASON | GINA | GINA | GINA | |||||||
GINA | KRISTEN | JASON | |||||||||
JASON | KRISTEN | ||||||||||
KRISTEN | |||||||||||
I need to combine the employees in columns A thru L into a single list in column M and remove any duplicates. I also need to leave the NULL value if it exists in any of the queries. The resulting list would look like this:
Employees |
---|
BOB |
BRIAN |
DANNY RAY |
DAVE |
EDWARD |
GINA |
JASON |
KRISTEN |
NULL |
I need VBA to do this as I want this to occur when I open the spreadsheet. I have each of the 12 queries set to run when I open the spreadsheet so they will be populated. I need the VBA to produce a list of unique employees that I can use in another worksheet with getpivotdata formulas to summarize some data on other worksheets.
Thanks in advance for any help with this.