Copy Template with Updated Values Each Time

Joined
Aug 6, 2011
Messages
1
Reaction score
0
Hi All,

I have a workbook with three main sheets. Two of them are hidden:

  • Start Here
  • Template - hidden
  • Clients - hidden
The goal is to have an employee enter a date in the "Start Here" sheet. Click a button to "Create New Worksheet" based on the hidden sheet "Template." A new "Template2" worksheet opens with the previously entered date from "Start Here" copied and pasted into a cell in the newly created "Template2" sheet.

My code works fine.......until I try to use the "Start Here" sheet again and create another new sheet with a different date. I can get a new "Template3" sheet, but the new date entered in the "Start Here" field copies to the previously created "Template2" sheet. It's as if it's copying the copy and not the original hidden "Template" sheet.

Here is my code:

Sub AddNewSheet()
Worksheets("TEMPLATE").Copy Before:=Worksheets(2)
Worksheets(2).Visible = xlSheetVisible

End Sub

I have also tried this code (works the same as the above code)

Sub CopyTSheet()
'Replace "Template" with the name of the sheet to be copied.
ActiveWorkbook.Sheets("Template").Copy _
After:=ActiveWorkbook.Sheets("Start Here")
ActiveWorkbook.Sheets(2).Visible = xlSheetVisible
End Sub

What am I missing? Can you tell I'm new at this?

I have two additional questions, but would love to solve this problem first.

Question #2: How do I get the newly created "Template" sheet to be the active sheet when created.
Question #3: How can I rename the newly created sheet based on the content of a cell instead of it naming it "Template3" "Template4" "Template5" etc.

Thanks for any help you can give me!

Regards,
Julie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top