Populate data from a column in one worksheet to a cell in multiple other sheets

Solved/Closed
Vee1893 - Updated on Dec 5, 2019 at 03:33 AM
 Vee1893 - Dec 11, 2019 at 01:53 AM
In a workbook, I want to be able to copy all the cells in column B of sheet "Raw Data" into multiple copies of an existing template sheet corresponding to each value. (note: not all cells have values).

Column B in the "Raw Data" sheet has about 800 cells/values. I want the workbook to be able to:

1. Pick up the 1st value from column B from the "Raw Data" sheet.
2. Create a copy of the existing "Template" sheet where this value will be pasted in cell B5.
3. Change the name of the copied template sheet to the value that was entered in cell B5.
4. Then continue steps 1-3 starting from the next number till it reaches the end of column B.

2 responses

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 555
Dec 10, 2019 at 12:08 PM
Hi Vee,

Since I don't think the provided links will guide you to your answer, you can try the following code:
Sub RunMe()
Dim shName As String

Sheets("Raw Data").Select

For Each cell In Range("B1:B" & Range("B" & Rows.Count).End(xlUp).Row)
    If cell.Value = vbNullString Then GoTo NextCell
    shName = cell.Value
    Sheets("Template").Copy before:=Sheets("Template")
    ActiveSheet.Name = shName
    Range("B5").Value = shName
NextCell:
Next cell
End Sub


Best regards,
Trowa
3
David Webb Posts 3177 Registration date Monday November 25, 2019 Status Administrator Last seen May 15, 2023   6,926
Dec 10, 2019 at 01:25 PM
Thanks Trowa!
0
Thank you Trowa. This really helped!
0
David Webb Posts 3177 Registration date Monday November 25, 2019 Status Administrator Last seen May 15, 2023   6,926
Dec 8, 2019 at 02:50 PM
Hello there,

Have a look at this forum answer on auto population data from multiple sheets that could help you out.

Or check out this article on how to populate multiple sheets based on data entered.

Hope this helps,
David

2