Copy original worksheet when opening a new tab

DJKempo

New Member
Joined
Sep 24, 2024
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hello,
I am trying to automate a training sign off process and was looking for help to solve my issue.
I would like to open a 'blank' training sign off sheet, using drop downs to fill in an employees details, and have an area for someone to sign it.
What I am look for is a way to then open the original 'blank' sign off sheet when I click on '+' to open a new worksheet, so then then I can fill in different employees' details.

Any help would be great! :)
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
This link should be able to guide you!

 
Upvote 0
Hello,
I am trying to automate a training sign off process and was looking for help to solve my issue.
I would like to open a 'blank' training sign off sheet, using drop downs to fill in an employees details, and have an area for someone to sign it.
What I am look for is a way to then open the original 'blank' sign off sheet when I click on '+' to open a new worksheet, so then then I can fill in different employees' details.

Any help would be great! :)

Welcome to Mr Excel.

Put this code in the Workbook code module. See attached image for help.

How are the new sheets to be named? Do you have a naming convention?
This convention will need to be implemented before this code can be used. Just let me know,

VBA Code:
Private Sub Workbook_NewSheet(ByVal Sh As Object)
Dim strNewSheet As String

  If MsgBox("Create a new Training Sign Off Sheet?", vbYesNo, "Question.") = vbYes Then

    strNewSheet = ActiveSheet.Name
    
    ' Substitute "BlankSignOffSheet" with the name of the template sheet.
    Worksheets("BlankSignOffSheet").Copy after:=Worksheets(strNewSheet)
    
    ActiveSheet.Name = "SignOffSheet1"
    
    Application.DisplayAlerts = False
    On Error Resume Next
    Worksheets(strNewSheet).Delete
    On Error GoTo 0
    Application.DisplayAlerts = True
  
  End If
  
End Sub
 

Attachments

  • WorkbookCodeModule.jpg
    WorkbookCodeModule.jpg
    57.1 KB · Views: 2
Upvote 0
This link should be able to guide you!

Thank you. I will look at this.
 
Upvote 0
Thanks. I was hoping the employees name that is selected in the drop-down menu could be used as the naming convention?
 
Upvote 0
Ideally, the end result I am looking for is a way to open a blank form and fill it out with drop downs, then once the form is completed the employee's name in the drop down is used to name the tab, and a new tab opens with a blank form.
Hope that makes sense?
 
Upvote 0
Ideally, the end result I am looking for is a way to open a blank form and fill it out with drop downs, then once the form is completed the employee's name in the drop down is used to name the tab, and a new tab opens with a blank form.
Hope that makes sense?
That is possible.

The sheet can be renamed as soon as the persons name is selected.

What cell is the drop down list in?
 
Upvote 0
I have not made the form yet, so it can be any at the moment. I know to manipulate code, just not how to begin form scratch.
 
Upvote 0
I have not made the form yet, so it can be any at the moment. I know to manipulate code, just not how to begin form scratch.
So :

Set up a worksheet called "BlankSignOffSheet". You can change this later.

Copy the procedures below into the worksheet code module and the workbook code module as indicated.

Click on the + to create a new sheet.

Change the entry in cell E9 in yellow in the new sheet and the worksheet name will change.

Worksheet Code Module.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo Err_Handler

  If Target = Range("E9") Then
  
    ActiveSheet.Name = Target.Value
  
  End If
  
Exit_Handler:

  Exit Sub

Err_Handler:

  MsgBox "There has been an error renaming this worksheet", vbOKOnly, "Warning"

  Resume Exit_Handler
  
End Sub

Workbook Code Module.
VBA Code:
Private Sub Workbook_NewSheet(ByVal Sh As Object)
Dim strNewSheet As String

  If MsgBox("Create a new Training Sign Off Sheet?", vbYesNo, "Question.") = vbYes Then

    strNewSheet = Sh.Name
        
    ' Substitute "BlankSignOffSheet" with the name of the template sheet.
    Worksheets("BlankSignOffSheet").Copy after:=Worksheets(strNewSheet)
    
    ActiveSheet.Name = "TemporarySheetName"
    
  End If
  
  Application.DisplayAlerts = False
  On Error Resume Next
  Sh.Delete
  On Error GoTo 0
  Application.DisplayAlerts = True
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,244
Messages
6,170,976
Members
452,372
Latest member
Natalie18

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top