Hello,
I have been trying to write a VBA script to take the active sheet and copy it to two sheets that are name V001 and V2Y
When I run the following error it says the name already exist, and I need to rename it.
Do you know what i am doing wrong?
Sub Add_Sheet()
Copy1
Copy2
End Sub
Private Sub Copy1()
ActiveSheet.Copy After:=Worksheets(Sheets.Count)
On Error Resume Next
ActiveSheet.Name = "V001"
End Sub
Private Sub Copy2()
Sheets("V001").Copy After:=Sheets(Sheets.Count)
On Error Resume Next
ActiveSheet.Name = "V2Y"
On Error GoTo 0
End Sub
Thanks!
I have been trying to write a VBA script to take the active sheet and copy it to two sheets that are name V001 and V2Y
When I run the following error it says the name already exist, and I need to rename it.
Do you know what i am doing wrong?
Sub Add_Sheet()
Copy1
Copy2
End Sub
Private Sub Copy1()
ActiveSheet.Copy After:=Worksheets(Sheets.Count)
On Error Resume Next
ActiveSheet.Name = "V001"
End Sub
Private Sub Copy2()
Sheets("V001").Copy After:=Sheets(Sheets.Count)
On Error Resume Next
ActiveSheet.Name = "V2Y"
On Error GoTo 0
End Sub
Thanks!