Copy and rename tab based on list

crocco

Board Regular
Joined
Jan 28, 2010
Messages
142
Hi all,

I have a tab called ‘template’

I have a tab called ‘products’ with a columnar list of text strings starting in cell A2.

I would like some VBA that copies and renames the ‘template’ tab for each item in the string list starting on cell A2 on the ‘products’ tab.

For example:

If products tab cell A2 = “Apples” and products tab cell A3 = “Pears”. The VBA I need would copy the ‘template’ tab twice and rename the tabs ‘Apples’ and ‘Pears’ respectively.

I will be left with three identical tabs called ‘template’, ‘apples’ and ‘pears’ (and the originals ‘products’ tab too).

I would like this to work for any number of items in the list on the ‘products’ tab.

Thanks!
 
I would hope that someone messing around with VBA would at least be exposed to the idea of loops, but I see your point Joe. I guess I just don't like the idea of people not wanting to learn. I mean, if you're using something, why not learn how it works! I don't buy people's excuses of "not needing to know". I'm more of the the opinion that if you use a thing, you should at least know enough to be dangerous with it.
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
You are welcome.
Glad we were able to help.
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,214
Members
453,024
Latest member
Wingit77

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