ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   looping cells though a named range (https://www.excelbanter.com/excel-programming/274799-looping-cells-though-named-range.html)

Jo[_4_]

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

Hank Scorpio

looping cells though a named range
 
On Tue, 19 Aug 2003 16:05:43 -0700, "Jo" wrote:

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

---------------------------------------------------------
Hank Scorpio
scorpionet who hates spam is at iprimus.com.au (You know what to do.)
* Please keep all replies in this Newsgroup. Thanks! *


All times are GMT +1. The time now is 01:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com