Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rename Worksheet Tab as File Name Using a Macro Cue Excel Discussion (Misc queries) 10 December 24th 09 06:38 PM
Macro: Copy a worksheet and rename it to a specified value mitch Excel Discussion (Misc queries) 2 February 16th 09 05:43 PM
Macro to copy a worksheet and rename based upon text entered in 1 edeaston Excel Discussion (Misc queries) 5 December 5th 08 05:47 PM
Rename worksheet in macro JBW Excel Worksheet Functions 1 September 24th 07 05:58 PM
new worksheet and rename from cell contents macro Henry Excel Worksheet Functions 1 September 12th 06 10:35 AM


All times are GMT +1. The time now is 06:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"