I have a tab called "Overview" where it asks me for the name of a project.
Once I write the project name, I want a macro to grab the project name, create a new tab, and change the name of the new tab to the project name.
Afterwards, I would like for the macro to go to another tab (let's call this tab "Template"), copy the whole worksheet, and paste the data into the newly created tab. I would like the formatting from the "Template" tab to flow to the new tab as well.
Sub AddNewTab()
Dim ws As Worksheet
Set ws = Worksheets("I DON'T KNOW WHAT TO WRITE HERE")
Rem Set working worksheets
Set WshSrc = ThisWorkbook.Worksheets("Source")
Set WshTrg = ThisWorkbook.Worksheets("Target")
'Create new tab based on project name
Sheets.Add(After:=ActiveWorkbook.Worksheets(ActiveWorkbook.Worksheets.Count)).Name = Range("I2")
'Copy data from Template tab
Worksheets("Template").Range("A1:H12").Copy
Worksheets("I DON'T KNOW WHAT TO WRITE HERE").Range("A1").PasteSpecial
'hide gridlines in a worksheet with the project name
ws.Activate
ActiveWindow.DisplayGridlines = False
End Sub
Cell I2 in the "Overview" page is where the project name will be written.