Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro for naming sheets?
I've just created a macro assigned to a button that creates a copy of a
sheet. Now, I would like to add a line or two of code in that macro that changes the name of the newly created sheet to what is written in a cell on a different sheet. Is this in any way possible? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro for naming sheets?
Try this
Sub test() ActiveSheet.Copy after:=Sheets(Sheets.Count) On Error Resume Next ActiveSheet.Name = Sheets("Sheet1").Range("A1").Value On Error GoTo 0 End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Olle Svensson" wrote in message ... I've just created a macro assigned to a button that creates a copy of a sheet. Now, I would like to add a line or two of code in that macro that changes the name of the newly created sheet to what is written in a cell on a different sheet. Is this in any way possible? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Microsoft Visual Basic: Compile error: Sum or Function not defined | Excel Worksheet Functions | |||
Copying Macro w/ different sheets | Excel Worksheet Functions | |||
Macro that stores all sheets as tab-delimited text files | Excel Discussion (Misc queries) | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Macro to link Sheets to main workbook | Excel Discussion (Misc queries) |