Run aloop using a list

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I would like to run a macro in loop using a list already prepared in Excel.
How can I program it?

Regards,

Sébastien
 
You can use the For Loop. Let's say your list is in column Z from Z12 to Z20
and you want to process the list - Output them:

Sub do_list()
Dim r As Range
Set r = Range("Z12:Z20")
For Each rr In r
MsgBox (rr.Value)
Next
End Sub
 
Thank's for your help,

Sebastien

Gary''s Student said:
You can use the For Loop. Let's say your list is in column Z from Z12 to Z20
and you want to process the list - Output them:

Sub do_list()
Dim r As Range
Set r = Range("Z12:Z20")
For Each rr In r
MsgBox (rr.Value)
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top