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

Hi all

I have a list of names in a range "A2:A65" on a sheet called ops names.

In the same workbook I have a sheet for each different name, (sheets2 to 65)
What I would like to do is to rename the sheets with the names in the range.

So the name in cell A2 becomes the sheet name of sheet 2, and so on and so
on.

The spreadsheet is used for time sheets, but the staff are not always the
same each month, hence the reason the change sheet names.

Any help greatly appreciated.


best regards

Andy


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default changing sheet names

Andy,

Simple loop required

For i = 2 To ActiveWorkbook.Worksheets.Count
Worksheets(i).Name = Worksheets("ops names").Cells(i, "A").Value
Next

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Andy Healey" wrote in message
...
Hi all

I have a list of names in a range "A2:A65" on a sheet called ops names.

In the same workbook I have a sheet for each different name, (sheets2 to

65)
What I would like to do is to rename the sheets with the names in the

range.

So the name in cell A2 becomes the sheet name of sheet 2, and so on and so
on.

The spreadsheet is used for time sheets, but the staff are not always the
same each month, hence the reason the change sheet names.

Any help greatly appreciated.


best regards

Andy




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default changing sheet names

Hi Andy

Try this with the sheet names as first

Sub test()
For a = 2 To ThisWorkbook.Sheets.Count
On Error Resume Next
Sheets(a).Name = Sheets("names").Cells(a, "A").Value
On Error GoTo 0
Next
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Andy Healey" wrote in message ...
Hi all

I have a list of names in a range "A2:A65" on a sheet called ops names.

In the same workbook I have a sheet for each different name, (sheets2 to 65)
What I would like to do is to rename the sheets with the names in the range.

So the name in cell A2 becomes the sheet name of sheet 2, and so on and so
on.

The spreadsheet is used for time sheets, but the staff are not always the
same each month, hence the reason the change sheet names.

Any help greatly appreciated.


best regards

Andy




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
Changing Defined Names Lelethu Excel Worksheet Functions 2 March 18th 10 09:43 AM
Cell names = sheet names Vince Excel Worksheet Functions 9 February 8th 08 03:59 PM
Changing mulitple tab names RD Excel Worksheet Functions 4 May 3rd 07 03:23 PM
Changing the order of names... Mickie New Users to Excel 2 May 24th 06 12:36 AM
changing file names saybut Excel Discussion (Misc queries) 2 February 20th 06 03:49 PM


All times are GMT +1. The time now is 05:31 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"