M
Madvark
I created a macro that sits on a worksheet(A), when run, it unhides
worksheet(B) and makes a copy of worksheet(B) prompting the user to
name the new worksheet(C). This works well. Part two of the process
includes a button on worksheet(C) that references the same macro on
worksheet(A). Clicking the button on worksheet(C) gives me a
"run-time error 1004" asking if I would like to debug. Debugging tags
this line in the macro:
Sheets("Earnings Code").Select
Full macro looks like this:
Sub NewEarningsCodeSheet()
Call UnhideEarningsCode
Sheets("Earnings Code").Select
shName = Application.InputBox("Enter The Name of the New Earnings
Code", "Delphia Consulting")
If (shName = False) Or shName = "" Then Exit Sub
Sheets("Earnings Code").Copy After:=Sheets(4)
ActiveSheet.Name = shName
End Sub
What am I doing wrong? It seems like it can only copy the worksheet
once or that it is trying to find it in a different location. I
appreciate any help, as I am somewhat new to this. Fun though.
worksheet(B) and makes a copy of worksheet(B) prompting the user to
name the new worksheet(C). This works well. Part two of the process
includes a button on worksheet(C) that references the same macro on
worksheet(A). Clicking the button on worksheet(C) gives me a
"run-time error 1004" asking if I would like to debug. Debugging tags
this line in the macro:
Sheets("Earnings Code").Select
Full macro looks like this:
Sub NewEarningsCodeSheet()
Call UnhideEarningsCode
Sheets("Earnings Code").Select
shName = Application.InputBox("Enter The Name of the New Earnings
Code", "Delphia Consulting")
If (shName = False) Or shName = "" Then Exit Sub
Sheets("Earnings Code").Copy After:=Sheets(4)
ActiveSheet.Name = shName
End Sub
What am I doing wrong? It seems like it can only copy the worksheet
once or that it is trying to find it in a different location. I
appreciate any help, as I am somewhat new to this. Fun though.