Macro to add Phone number and Email address to list of names.

Breanna

New Member
Joined
Sep 19, 2013
Messages
13
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, (y) to anyone who gets it! :biggrin: ):

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!!!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,215,816
Messages
6,127,038
Members
449,356
Latest member
tstapleton67

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top