looping cells though a named range

  • Thread starter Thread starter Jo
  • Start date Start date
J

Jo

Hi
Can anyone give me an example of looping cells though a
named range.
Thanks
Jo
 
Hi
Can anyone give me an example of looping cells though a
named range.
Thanks
Jo

In the example below, MyRange is a range name defined as
=Sheet1!$A$1:$A$11

Sub LoopThroughRange()

Dim rng As Excel.Range

For Each rng In ActiveSheet.Range("myrange")

Debug.Print rng.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