myactiondesign
New Member
- Joined
- Mar 30, 2013
- Messages
- 31
Hey everyone,
I'm looking to create a fresh workbook based off a template for OKR goal tracking every quarter.
I have a list of team names and the below code already works to duplicate the template and create new tabs, change the tab names and change the title of the template to the team name.
This reads from a table like this:
Where I'm struggling is to also change the colour of the tab based on the team name.
What I'd like to do is have a third column with an RGB colour and have the tab colour changed when created.
Can anyone help? Much appreciated and thanks in advance for your time!
Thank you!
I'm looking to create a fresh workbook based off a template for OKR goal tracking every quarter.
I have a list of team names and the below code already works to duplicate the template and create new tabs, change the tab names and change the title of the template to the team name.
VBA Code:
Sub DuplicateTemplate()
Dim ws As Worksheet, Number As Range
For Each Code In Sheets("Inputs").Range("A2", Sheets("Inputs").Range("A" & Rows.Count).End(xlUp))
Sheets("Template").Copy After:=Worksheets(Worksheets.Count)
Worksheets(Worksheets.Count).Range("A1") = Code
Worksheets(Worksheets.Count).Range("B1") = Code.Offset(, 1)
Worksheets(Worksheets.Count).Name = Code.Offset(, 1)
Next Code
End Sub
This reads from a table like this:
Code | Names |
1 | Sample team name |
2 | Another sample team name |
Where I'm struggling is to also change the colour of the tab based on the team name.
What I'd like to do is have a third column with an RGB colour and have the tab colour changed when created.
Can anyone help? Much appreciated and thanks in advance for your time!
Thank you!