Execute Macro while using listed name for each run.

Turbo68

Board Regular
Joined
Jan 31, 2014
Messages
118
I have a macro that I want to run automatically using a list in AD9 thru AD23 ( 20 names). The Macro uses the name to sort a sheet and gets it ready to email. What I am trying to do is to get it to use the list starting with the first name in AD9 and copy it to A2 then run the macro 1. Then, when it is finished copy the 2nd name into A2 and repeat macro 1. Doing this all thru my list till blank space ( needed for further additions) and then exiting macro.

Thank in advance.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Code:
Sub ProcessList()

Dim rng As Range
Dim r As Long
Set rng = ActiveSheet.Range("AD9")
r = 0
Do While rng.Offset(r, 0) <> ""
    Range("A2") = rng.Offset(r, 0)
    ' run your macro here
    r = r + 1
Loop
MsgBox "Done.", vbExclamation
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,801
Messages
6,181,047
Members
453,014
Latest member
Chris258

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