Loop Through Named Range / Save Copy As

marka87uk

Board Regular
Joined
Mar 24, 2007
Messages
247
Hi,

I have a list of categories named Categories - it contains about 100 different types.

What I'd like to do is loop through each category, firstly setting the contents of a cell (say A2) to the category name, and then saving a copy of workbook with that category name in the file title.

Can anyone help please? :)
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Cheeky bump, sorry...

I'm fine with saving a copy of the file and setting the cell value, I'm just a little lost on looping through the named range.

Many thanks. :)
 
Upvote 0
I got it working in the end and it was much simpler than I realised...

Here is the solution to help anyone else who stumbles upon this page!

Dim Category As Range
For Each Category In Range("Categories")
Range("B4").Value = Category
Next Category
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,543
Members
452,924
Latest member
JackiG

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?

Disable AdBlock

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
Back
Top