Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default VBA Worksheet change name

I wish to change the name of a worksheet (Which name can be varied) to
apredetermined name say Sheet1.

I particular wish this be done within a VBA statement. I have one macro
that affects several workbooks and consequently the worksheets will have
different names and I wish to use a one predetermined name to cover this
variation.

Thanks
--
James
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default VBA Worksheet change name

You can rename the worksheet with code like

Worksheets("OldName").Name = "NewName"

If you want to get the new name from a cell value, use something like

Worksheets("OldName").Name = Range("A1").Text

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]



On Tue, 26 Jan 2010 07:57:01 -0800, James C
wrote:

I wish to change the name of a worksheet (Which name can be varied) to
apredetermined name say Sheet1.

I particular wish this be done within a VBA statement. I have one macro
that affects several workbooks and consequently the worksheets will have
different names and I wish to use a one predetermined name to cover this
variation.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default VBA Worksheet change name

How about using ActiveSheet in your code?

Or refer to the sheet codename

Worksheets(1) ignores the actual sheet name displayed on the sheet tab.


Gord Dibben MS Excel MVP

On Tue, 26 Jan 2010 07:57:01 -0800, James C
wrote:

I wish to change the name of a worksheet (Which name can be varied) to
apredetermined name say Sheet1.

I particular wish this be done within a VBA statement. I have one macro
that affects several workbooks and consequently the worksheets will have
different names and I wish to use a one predetermined name to cover this
variation.

Thanks


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
Worksheet Change Event Tony S.[_2_] Excel Discussion (Misc queries) 11 February 18th 09 01:04 AM
change formula in a shared worksheet without losing change history DCE Excel Worksheet Functions 5 July 25th 08 01:37 PM
Help Please, Worksheet Change ilvmgicker Excel Worksheet Functions 1 June 14th 06 09:41 AM
how do i change the currency on my worksheet help Excel Discussion (Misc queries) 1 October 11th 05 12:15 PM
Worksheet Row Change event crazybass2 Excel Discussion (Misc queries) 4 December 8th 04 05:29 PM


All times are GMT +1. The time now is 05:46 AM.

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

About Us

"It's about Microsoft Excel"