ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with Looping I think (https://www.excelbanter.com/excel-programming/359711-help-looping-i-think.html)

Mike

Help with Looping I think
 
I have a range of cells A1:A10. I have named the range "Data". How can I
specify to run a procedure for every cell within that range without
specifying cell references? In case a cell is added or deleted to the range
name, I still only want the procedure to dun for the cells within that range
name. Make sense?

Jim Thomlinson

Help with Looping I think
 
Give something like this a try...

Dim rng as range

for each rng in Range("MyRange")
msgbox rng.value
next rng
--
HTH...

Jim Thomlinson


"Mike" wrote:

I have a range of cells A1:A10. I have named the range "Data". How can I
specify to run a procedure for every cell within that range without
specifying cell references? In case a cell is added or deleted to the range
name, I still only want the procedure to dun for the cells within that range
name. Make sense?


Mike

Help with Looping I think
 
thanks

"Jim Thomlinson" wrote:

Give something like this a try...

Dim rng as range

for each rng in Range("MyRange")
msgbox rng.value
next rng
--
HTH...

Jim Thomlinson


"Mike" wrote:

I have a range of cells A1:A10. I have named the range "Data". How can I
specify to run a procedure for every cell within that range without
specifying cell references? In case a cell is added or deleted to the range
name, I still only want the procedure to dun for the cells within that range
name. Make sense?



All times are GMT +1. The time now is 07:25 PM.

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