-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRESP_NOTES
33 lines (21 loc) · 979 Bytes
/
RESP_NOTES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
https://stackoverflow.com/questions/25434910/excel-vba-copying-template-worksheet-and-linking-cell-and-naming-sheet
Sub CreateLinkedSheets()
Dim rngCreateSheets As Range
Dim oCell As Range
Dim oTemplate As Worksheet
Dim oSummary As Worksheet
Dim oDest As Worksheet
Set oTemplate = Worksheets("Template")
Set oSummary = Worksheets("Summary")
Set rngCreateSheets = Worksheets("Summary").Range("A1", Range("A1").End(xlDown))
'Above line assumes NO blank cells in your list of school supplies
For Each oCell In rngCreateSheets.Cells
oTemplate.Copy After:=Worksheets(Sheets.Count)
Set oDest = ActiveSheet
oDest.Name = oCell.Value
oDest.Range("A1").Value = oCell.Value
oSummary.Hyperlinks.Add Anchor:=oCell, Address:="", SubAddress:= _
oDest.Name & "!A1", TextToDisplay:=oDest.Name
Next oCell
End Sub
VBA TABLE LIST OBJECTS: https://exceloffthegrid.com/vba-excel-tables-code/