jacksum336
New Member
- Joined
- Jun 16, 2015
- Messages
- 10
Hi,
I would like to create a button and assign it a macros.
The macros would insert a new sheet at the end of my workbook that has an existing template.
The existing template worksheet's current file name is Labor. My workbook name is LaborTracking.
I did the following. I created a button using developer.
I hit Alt+11 to open up the VBA editor and created a new module.
Inside the module, I coded the following after looking through some forums:
Sub CopySheet()
Dim MySheetName As String
MySheetName = Labor.Text
Sheets("MasterSheet").Copy After:=Sheets("MasterSheet")
ActiveSheet.Name = MySheetName
End Sub
Thank you for your help!
I would like to create a button and assign it a macros.
The macros would insert a new sheet at the end of my workbook that has an existing template.
The existing template worksheet's current file name is Labor. My workbook name is LaborTracking.
I did the following. I created a button using developer.
I hit Alt+11 to open up the VBA editor and created a new module.
Inside the module, I coded the following after looking through some forums:
Sub CopySheet()
Dim MySheetName As String
MySheetName = Labor.Text
Sheets("MasterSheet").Copy After:=Sheets("MasterSheet")
ActiveSheet.Name = MySheetName
End Sub
Thank you for your help!