Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Similar to a question from yesterday, but a new twist.
I have the following code which upon clicking the OK command button, the user is asked in a message box to enter a name for a new worksheet. The active worksheet is then copied to this new sheet and it is saved in the same workbook. Private Sub cmdOK_Click() Do Dim nSheet As Worksheet Dim NameBox As String NameBox = Application.InputBox("Please type a name for the new worksheet", "Creating New Sheet", , , , , , 2) If NameBox = "" Or NameBox = "False" Then MsgBox "Please type a name for the new worksheet" End If Loop Until Not NameBox = "" Or NameBox = "False" Sheets("STD Calc").Copy Befo=Sheets(2) Set nSheet = ActiveSheet nSheet.Name = NameBox Unload Me End Sub How can I tweak this code so that it doesn't copy to a brand new worksheet as named by the user, rather it copies to an existing worksheet within this same workbook? The user would just need to name which worksheet it is copied to. Thanks for any help! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to delete a duplicate Excel worksheet within that worksheet? | Excel Discussion (Misc queries) | |||
Delete Duplicate Rows Macro Question | Excel Discussion (Misc queries) | |||
Challenging Duplicate Question... | Excel Worksheet Functions | |||
Another question on how to find duplicate data | Excel Worksheet Functions | |||
Newbie question on deleting duplicate rows | Excel Programming |