ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Looping through named ranges (https://www.excelbanter.com/excel-programming/337435-looping-through-named-ranges.html)

JFamilo[_12_]

Looping through named ranges
 

I would like to loop through named ranges in a particular worksheet. Is
there a way to do this. Something like

Dim MyRange As Range
For each MyRange in ThisWorkbook.Worksheets("Sheet1").Ranges
.....Do something....
Next MyRange


however, this of course, doesn't work.

Any ideas?


--
JFamilo
------------------------------------------------------------------------
JFamilo's Profile: http://www.excelforum.com/member.php...o&userid=17276
View this thread: http://www.excelforum.com/showthread...hreadid=396243


Tom Ogilvy

Looping through named ranges
 
Dim nm as Name
for each nm in ThisworkbookNames

or

for each nm in Thisworkbook.Worksheets(1).Names

for just sheet level names.

--
Regards,
Tom Ogilvy

"JFamilo" wrote in
message ...

I would like to loop through named ranges in a particular worksheet. Is
there a way to do this. Something like

Dim MyRange As Range
For each MyRange in ThisWorkbook.Worksheets("Sheet1").Ranges
....Do something....
Next MyRange


however, this of course, doesn't work.

Any ideas?


--
JFamilo
------------------------------------------------------------------------
JFamilo's Profile:

http://www.excelforum.com/member.php...o&userid=17276
View this thread: http://www.excelforum.com/showthread...hreadid=396243




JFamilo[_13_]

Looping through named ranges
 

Thanks! This really helps!


--
JFamilo
------------------------------------------------------------------------
JFamilo's Profile: http://www.excelforum.com/member.php...o&userid=17276
View this thread: http://www.excelforum.com/showthread...hreadid=396243



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

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