Hi All
Happy Wednesday to you all.
I have a workbook with a number of hidden sheets: eg: Emp Ins , Practical Comp, Final Completion.. All these worksheets are hidden.
I have a worksheet that is called Main Menu and it has buttons on it that you click to add a New Employers Instruction, or Final Completion or Practical Completion.
However, I can't get the code to work that will look for the hidden worksheet, eg: Emp Ins and then make a copy of it and name the tab Emp Ins 1. If I then click the button to add another Emp Ins I need the VBA code to create another copy of Emp Ins but assign it number 2 as I have already created Emp Ins 1.
I hope the above makes sense.
The code I have used is as follows:
Sub ShowHideEmpInstruction()
Sheets("Emp Ins").Visible = False
'Make copy of master'
Sheets("Emp Ins").Copy After:=Sheets("Schedule of Payments")
Sheets("Emp Ins(2)").Visible = True
Sheets("Emp Ins (2)").Select
End Sub
However, it just goes to the last worksheet and erases all the data and just add number 2 to the cell.
Any help/guidance would be greatly appreciated.
Thanking you in advance
Regards
Sue
Happy Wednesday to you all.
I have a workbook with a number of hidden sheets: eg: Emp Ins , Practical Comp, Final Completion.. All these worksheets are hidden.
I have a worksheet that is called Main Menu and it has buttons on it that you click to add a New Employers Instruction, or Final Completion or Practical Completion.
However, I can't get the code to work that will look for the hidden worksheet, eg: Emp Ins and then make a copy of it and name the tab Emp Ins 1. If I then click the button to add another Emp Ins I need the VBA code to create another copy of Emp Ins but assign it number 2 as I have already created Emp Ins 1.
I hope the above makes sense.
The code I have used is as follows:
Sub ShowHideEmpInstruction()
Sheets("Emp Ins").Visible = False
'Make copy of master'
Sheets("Emp Ins").Copy After:=Sheets("Schedule of Payments")
Sheets("Emp Ins(2)").Visible = True
Sheets("Emp Ins (2)").Select
End Sub
However, it just goes to the last worksheet and erases all the data and just add number 2 to the cell.
Any help/guidance would be greatly appreciated.
Thanking you in advance
Regards
Sue