Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro works Macro does not work | Excel Discussion (Misc queries) | |||
Email Macro only sometime works? | Excel Discussion (Misc queries) | |||
macro works separately but not together... | Excel Programming | |||
Macro works from RUN but not from shortcut | Excel Programming | |||
macro works in .xlt but not .xls | Excel Programming |