Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I've got a userform created with a textbox, an apply button and a cancel
button. If OK is clicked, i want the macro to duplicate a specific named worksheet (say template) and rename the duplicate to the value in the textbox. This doesn't seem to be terrible difficult, but I'm having problems. Any advice? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
OldSheet = "Sheet1"
Worksheets(OldSheet).Copy after:=Sheets(Sheets.Count) Set Newsht = ActiveSheet Newsht.Name = "Joel" "mitch" wrote: I've got a userform created with a textbox, an apply button and a cancel button. If OK is clicked, i want the macro to duplicate a specific named worksheet (say template) and rename the duplicate to the value in the textbox. This doesn't seem to be terrible difficult, but I'm having problems. Any advice? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
Private Sub OK_Click() Sheets("Template").Copy After:=ActiveSheet ActiveSheet.Name = Me.TextBox1 Unload Me End Sub where TextBox1 is the name of your textbox on the form. and the ok button is named OK. -- If this helps, please click the Yes button Cheers, Shane Devenshire "mitch" wrote: I've got a userform created with a textbox, an apply button and a cancel button. If OK is clicked, i want the macro to duplicate a specific named worksheet (say template) and rename the duplicate to the value in the textbox. This doesn't seem to be terrible difficult, but I'm having problems. Any advice? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to copy a worksheet and rename based upon text entered in 1 | Excel Discussion (Misc queries) | |||
Copy worksheet and rename sheet | Excel Discussion (Misc queries) | |||
Copy, Paste and Rename a Range using a macro | Excel Discussion (Misc queries) | |||
Macro REQ: Automatically copy a template sheet and rename | Excel Worksheet Functions | |||
Rename worksheet in macro | Excel Worksheet Functions |