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

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
You are welcome.
Glad we were able to help.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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