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:
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
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
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