Hello Excel buddies!
Can anyone help me with a macro to add some phone numbers and email addresses to a list of names?
I have 6 names that are repeated in various orders in a column, and I need the next column to be their direct phone number, and the next one to be their email address.
For example (the first row is a header row (row 1), the columns will not be A, B & C, though. The header rows are accurate, but, obviously, the names/phone/emails are aliases... I just needed some names to type here, to anyone who gets it! ):
<tbody>
</tbody>
And it should end up like the table below, after the macro.
<tbody>
</tbody>
Basically, I just need a series of if/then statements... but I don't know how to write it all out myself. I can substitute the real names/phone/email for the aliases once I have a working macro.
There will not necessarily be this many rows, sometimes there will be more, sometimes less. A looping macro would work, if possible, that could go till there is no longer a name in the Agent1 column.
Thanks!!!
Can anyone help me with a macro to add some phone numbers and email addresses to a list of names?
I have 6 names that are repeated in various orders in a column, and I need the next column to be their direct phone number, and the next one to be their email address.
For example (the first row is a header row (row 1), the columns will not be A, B & C, though. The header rows are accurate, but, obviously, the names/phone/emails are aliases... I just needed some names to type here, to anyone who gets it! ):
AGENT1 | |||
THE DOCTOR | |||
ROSE TYLER | |||
JACK HARKNESS | |||
MARTHA JONES | |||
DONNA NOBLE | |||
MICKEY SMITH | |||
JACK HARKNESS | |||
THE DOCTOR | |||
THE DOCTOR | |||
ROSE TYLER | |||
ROSE TYLER | |||
ROSE TYLER | |||
DONNA NOBLE | |||
THE DOCTOR | |||
DONNA NOBLE | |||
MARTHA JONES | |||
MICKEY SMITH | |||
<tbody>
</tbody>
And it should end up like the table below, after the macro.
AGENT1 | AGENT PHONE | AGENT EMAIL | |
THE DOCTOR | 555-555-1234 | doctor@tardis.com | |
ROSE TYLER | 555-555-1235 | rose@tardis.com | |
JACK HARKNESS | 555-555-1236 | jack@tardis.com | |
MARTHA JONES | 555-555-1237 | martha@tardis.com | |
DONNA NOBLE | 555-555-1238 | donna@tardis.com | |
MICKEY SMITH | 555-555-1239 | mickey@tardis.com | |
JACK HARKNESS | 555-555-1236 | jack@tardis.com | |
THE DOCTOR | 555-555-1234 | doctor@tardis.com | |
THE DOCTOR | 555-555-1234 | doctor@tardis.com | |
ROSE TYLER | 555-555-1235 | rose@tardis.com | |
ROSE TYLER | 555-555-1235 | rose@tardis.com | |
ROSE TYLER | 555-555-1235 | rose@tardis.com | |
DONNA NOBLE | 555-555-1238 | donna@tardis.com | |
THE DOCTOR | 555-555-1234 | doctor@tardis.com | |
DONNA NOBLE | 555-555-1238 | donna@tardis.com | |
MARTHA JONES | 555-555-1237 | martha@tardis.com | |
MICKEY SMITH | 555-555-1239 | mickey@tardis.com | |
<tbody>
</tbody>
Basically, I just need a series of if/then statements... but I don't know how to write it all out myself. I can substitute the real names/phone/email for the aliases once I have a working macro.
There will not necessarily be this many rows, sometimes there will be more, sometimes less. A looping macro would work, if possible, that could go till there is no longer a name in the Agent1 column.
Thanks!!!