Hello. I come here seeking help, I have tried searching for a solution for this but i still don't know what's wrong.

I have this error: Run-time error '9': Subscript out of range.

In debug it opens my VBA:

Application.ScreenUpdating = False 'Hide screen flashing while creating and sorting
Sheets("Template").Visible = True 'Make sheet visible before Copy
> Sheets("Template").Copy After:=Sheets(3) 'copy template
ActiveSheet.Name = NewNameToAdd 'rename new sheet
Sheets("Template").Visible = False 'Hide Template

The stop line is Sheets("Template").Copy After:=Sheets(3)

I have never had a problem with this before, and no matter how I run it, I get the same error.