Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Naming worksheets


Hi All

Is there a way of giving the worksheet name the same as the value of a
cell?

Thanks

Oz


--
ozcank


------------------------------------------------------------------------
ozcank's Profile: http://www.excelforum.com/member.php...fo&userid=5328
View this thread: http://www.excelforum.com/showthread...hreadid=382406

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Naming worksheets


You can do by sheetname:

Sheets("Sheet1").Name = Range("A1").value

or by sheetindex

Sheets(1).Name = Range("A1").value


--
Kaak
------------------------------------------------------------------------
Kaak's Profile: http://www.excelforum.com/member.php...fo&userid=7513
View this thread: http://www.excelforum.com/showthread...hreadid=382406

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Naming worksheets

Hi,

Yeah just pass the name of the cell to a variable and then use that to
name the sheet, something like:

Dim ShtName as string
ShtName = Range("A5").value
Activesheet.name = ShtName

If you then wanted to name quite a few you could then just set a loop
hence the reason I used activesheet rather than sheets("name")

James

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Naming worksheets

hi ozcank...

try this:

imagine sheets(1) as the first sheet of the workbook:
Sheets(1).Name = Cells(1, 1)

sheet(1) have the value of first row,column

Miguel

"ozcank" wrote:


Hi All

Is there a way of giving the worksheet name the same as the value of a
cell?

Thanks

Oz


--
ozcank


------------------------------------------------------------------------
ozcank's Profile: http://www.excelforum.com/member.php...fo&userid=5328
View this thread: http://www.excelforum.com/showthread...hreadid=382406


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Naming worksheets



Worksheets("Sheet1").name=Range("A1").Value

You can omit the ".Value"

"ozcank" wrote:


Hi All

Is there a way of giving the worksheet name the same as the value of a
cell?

Thanks

Oz


--
ozcank


------------------------------------------------------------------------
ozcank's Profile: http://www.excelforum.com/member.php...fo&userid=5328
View this thread: http://www.excelforum.com/showthread...hreadid=382406




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Naming worksheets


Thanks guys, it works perfectly now.

Cheers

Oz


--
ozcank


------------------------------------------------------------------------
ozcank's Profile: http://www.excelforum.com/member.php...fo&userid=5328
View this thread: http://www.excelforum.com/showthread...hreadid=382406

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
Naming new worksheets paz24 Excel Discussion (Misc queries) 0 February 1st 06 11:46 AM
Naming worksheets... tojo107 Excel Discussion (Misc queries) 3 April 7th 05 07:29 PM
naming worksheets Shooter Excel Worksheet Functions 1 December 3rd 04 04:09 PM
Worksheets Add & Naming Kevin H. Stecyk[_2_] Excel Programming 4 August 20th 04 05:19 PM
Naming Worksheets in VBE Don Guillett[_4_] Excel Programming 0 July 18th 03 08:17 PM


All times are GMT +1. The time now is 07:34 AM.

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"