Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Rename a Worksheet within a Macro
I would like to code a macro that creates a new worksheet at the back of a
workbook and then renames the new sheet with a name derived from the value derived within a cell. I initially created the macro by recording keboard commands. Unfortunately the macro transformed the cell contents into the hard codes value within double quotes. I want the macro to work with any value held within the cell. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Rename a Worksheet within a Macro
Worksheets.Add After:=Worksheets(Worksheets.Count)
ACtivesheet.Name = Worksheets("Sheet1").Range("A1").Value -- HTH Bob Phillips (remove nothere from email address if mailing direct) "AJChrumka" wrote in message ... I would like to code a macro that creates a new worksheet at the back of a workbook and then renames the new sheet with a name derived from the value derived within a cell. I initially created the macro by recording keboard commands. Unfortunately the macro transformed the cell contents into the hard codes value within double quotes. I want the macro to work with any value held within the cell. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Rename a Worksheet within a Macro
Dim rng as Range, sh as Worksheet
set rng = Activesheet.Range("A1").Value set sh = worksheets.add( After:=Worksheets(worksheets.count)) sh.Name = rng.Text -- Regards, Tom Ogilvy "AJChrumka" wrote in message ... I would like to code a macro that creates a new worksheet at the back of a workbook and then renames the new sheet with a name derived from the value derived within a cell. I initially created the macro by recording keboard commands. Unfortunately the macro transformed the cell contents into the hard codes value within double quotes. I want the macro to work with any value held within the cell. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Rename Worksheet Tab as File Name Using a Macro | Excel Discussion (Misc queries) | |||
Macro: Copy a worksheet and rename it to a specified value | Excel Discussion (Misc queries) | |||
Macro to copy a worksheet and rename based upon text entered in 1 | Excel Discussion (Misc queries) | |||
Rename worksheet in macro | Excel Worksheet Functions | |||
new worksheet and rename from cell contents macro | Excel Worksheet Functions |