# How do i loop through cells in my named ranges

#### Sahil123

##### Well-known Member
Hi All,

I have 3 named ranges in my sheet

How do i loop through each cell in those named ranges

For cell in ????
Cell.select
Next Cell

and how can i also set it up as a variable as an alternative i.e

Arr = Range("A","B","C")

For each cell in Arr
Cell.select
Next Cell

Thanks

### Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi All,

I have 3 named ranges in my sheet

How do i loop through each cell in those named ranges

For cell in ????
Cell.select
Next Cell

and how can i also set it up as a variable as an alternative i.e

Arr = Range("A","B","C")

For each cell in Arr
Cell.select
Next Cell

Thanks

Bump anyone

Thank You So Much

Assuming you have valid named ranges named A B and C
Although I don't think C is a valid name, it's short for Column..
But I assume A B and C are just simple examples..

This should work
Code:
``````Set Arr = Range("A, B, C")

For Each Cell In Arr
Cell.Select
Next Cell``````

Assuming you have valid named ranges named A B and C
Although I don't think C is a valid name, it's short for Column..
But I assume A B and C are just simple examples..

This should work
Code:
``````Set Arr = Range("A, B, C")

For Each Cell In Arr
Cell.Select
Next Cell``````

Thank You

Yep they were just used to show as an example

Waht if i named them in my spreadsheet

how would i reference them in my for each loop?

Would i need to define it in a variable or could i omit that and do something like

For each cell in (Named ranges)??
Next cell

Thanks

That's what I just showed.

If you have valid named ranges, say
rng1 = A1:A10
rng2 = E1:E20
rng3 = G10:J30

Then this will loop through ALL of those cells

Code:
``````Set Arr = Range("rng1, rng2, rng3")

For Each Cell In Arr
Cell.Select
Next Cell``````

Replies
7
Views
295
Replies
5
Views
524
Replies
4
Views
142
Replies
5
Views
144
Replies
1
Views
151

1,196,248
Messages
6,014,226
Members
441,808
Latest member
xplainer

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

### Which adblocker are you using?

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

### Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back