Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have created a button that I want to assign a macro to that will take the
information in a cell and make it the name of a new worksheet. This worksheet needs to be a copy of an existing worksheet (#2 in position in the line of worksheets currently) but with the name the user enters in the box provided. Any suggestions? -Kai |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jul 2, 4:40 pm, Kai Cunningham
wrote: I have created a button that I want to assign a macro to that will take the information in a cell and make it the name of a new worksheet. This worksheet needs to be a copy of an existing worksheet (#2 in position in the line of worksheets currently) but with the name the user enters in the box provided. Any suggestions? -Kai Hello Kal, This macro use the value in cell A1 to rename the second worksheet (#2 in position). Sub RenameSheet() Worksheets(2).Name = ActiveSheet.Range("A1").Name End Sub Sincerely, Leith Ross |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jul 2, 4:40 pm, Kai Cunningham
wrote: I have created a button that I want to assign a macro to that will take the information in a cell and make it the name of a new worksheet. This worksheet needs to be a copy of an existing worksheet (#2 in position in the line of worksheets currently) but with the name the user enters in the box provided. Any suggestions? -Kai Hello Kal, This macro use the value in cell A1 to rename the second worksheet (#2 in position). Sub RenameSheet() Worksheets(2).Name = ActiveSheet.Range("A1").Text End Sub Sincerely, Leith Ross |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Try this sub: Sub AddNewSheet() Dim SheetName As String SheetName = Range("A1").Value Sheets(2).Copy after:=Sheets(Sheets.Count) On Error GoTo ErrHandler: ActiveSheet.Name = SheetName Exit Sub ErrHandler: MsgBox SheetName & " is not a valid sheet name or is already used." End Sub Regards, Manu/ "Kai Cunningham" a écrit dans le message de news: ... I have created a button that I want to assign a macro to that will take the information in a cell and make it the name of a new worksheet. This worksheet needs to be a copy of an existing worksheet (#2 in position in the line of worksheets currently) but with the name the user enters in the box provided. Any suggestions? -Kai |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Create Worksheet From Values in Existing Cells Using Existing Worksheet as Template. | Excel Programming | |||
create a macro to copy a worksheet into another | Excel Discussion (Misc queries) | |||
Create a Macro to Copy a Worksheet, and link certain cells... | Excel Programming | |||
copy multiple worksheets of a workbook, and paste onto a Word document ( either create new doc file or paste onto an existing file.) I need this done by VBA, Excel Macro | Excel Programming | |||
How to create a macro to copy data from a column to a row in another worksheet? | Excel Programming |