Populate Cell in multiple sheets from list on sheet1

JCartice

New Member
Joined
May 31, 2012
Messages
1
So I have a workbook that starts off with 2 sheets. "Template" and "Sheet1". On Sheet 1 there are a few lists, the important ones being a list of what they want sheet names to be, the next list being what they want the text a specific cell (B8) in the new sheets to be.
I have 2 buttons on Sheet 1, and the first one works perfectly, taking the names from the first list and creating new sheets based off the template named after the first list.
I am having problems with the second button.
I want to take the second list and use it to populate cell B8 on the corresponding newly created sheets.
If I record the macro maunally the VBA code is the following:
Code:
Sub Button2_Click()
    Range("G2").Select
    Application.Run "DoCopy"
    Sheets("Day1").Select
    Range("B8").Select
    Application.Run "DoPaste"
    Sheets("Sheet1").Select
    Range("G3").Select
    Application.Run "DoCopy"
    Sheets("Day2").Select
    Range("B8").Select
    Application.Run "DoPaste"
    Sheets("Sheet1").Select
End Sub
Obviously there would be more than 2 sheets, normally it would be about a dozen.
The list is not a set length (it will always be the same as the number of new sheets, but may have blanks which should not be ignored).
Also, in case the values change I want to be able to update the field by changing the list and clicking.

I'm assuming this would involve some sort of loop, but can't seem to figure it out.
Thank you
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,203,462
Messages
6,055,565
Members
444,799
Latest member
CraigCrowhurst

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