Hi all
I'm having a few problems working put how to copy a Worksheet (WS) AND then re-name it using the value of a cell from a different sheet but in the same workbook (WB).
The WB is being used to enable the end user to click a button on the Menu WS that will show a specific type of Userform (dependant on what type of template they need to fill in) asking them to enter a relevant date.
Once they click OK the date is written to another Worksheet called 'Dates' into cell C3 then the relevant template WS needs to be copied and then renamed using the value in dates C3.
I have found and adjusted the following sub on this forum but it keeps erroring out with 'subscript out of range' and I really don't have a clue why
Could someone please help me to resolve this one.
Many thanks
Paul
I'm having a few problems working put how to copy a Worksheet (WS) AND then re-name it using the value of a cell from a different sheet but in the same workbook (WB).
The WB is being used to enable the end user to click a button on the Menu WS that will show a specific type of Userform (dependant on what type of template they need to fill in) asking them to enter a relevant date.
Once they click OK the date is written to another Worksheet called 'Dates' into cell C3 then the relevant template WS needs to be copied and then renamed using the value in dates C3.
I have found and adjusted the following sub on this forum but it keeps erroring out with 'subscript out of range' and I really don't have a clue why
Could someone please help me to resolve this one.
Many thanks
Paul
VBA Code:
Sub NewTemplate()
Dim WSCount As Long
WSCount = Worksheets.Count
ActiveWorkbook.Sheets("Template").Copy _
After:=ActiveWorkbook.Sheets(WSCount)
Sheets("Dates").Name = Sheets("Dates").Range("C3").Value & WSCount + 1
End Sub