Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Worksheet Naming Options

I have a list of 40 names that I want to use to Name 40 worksheets in a
workbook. Is there a way to do this without having to type each name in each
worksheet Name area?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 694
Default Worksheet Naming Options

Hi Comic Fly:

There are a number of ways of doing this one way is as follows:

In you list you have in say col A old you enter the old names and col B new
name and the list starts on row 2 (row one headings).

It also commens in col C.

The old names start in row 2 and you can do this quite easily =
"Sheet"&Row()-1 if the first sheet is called Sheet1 that you want to cfhange.

And then you run this macro. It also reports in col C if it has done it or
not.

Sub renamesheets()
Dim lRow As Long
Dim lLastRow As Long
On Error Resume Next
Application.ScreenUpdating = False
lRow = 2
With ActiveSheet
lLastRow = .Cells.Rows.Count
Do While (lRow < lLastRow And .Cells(lRow, 1) < "")
Worksheets(.Cells(lRow, 1).Value).Name _
= .Cells(lRow, 2).Value
If Err.Number < 0 Then
.Cells(lRow, 3) = "Error"
Err.Clear
Else
.Cells(lRow, 3) = "Done"
End If
lRow = lRow + 1
Loop
End With
Application.ScreenUpdating = True
End Sub

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"ComicFly" wrote:

I have a list of 40 names that I want to use to Name 40 worksheets in a
workbook. Is there a way to do this without having to type each name in each
worksheet Name area?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Worksheet Naming Options

This worked very well. Thank you very much.

ComicFly

"ComicFly" wrote:

I have a list of 40 names that I want to use to Name 40 worksheets in a
workbook. Is there a way to do this without having to type each name in each
worksheet Name area?

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 same cell in different worksheet with 2 value changing on e Yan Excel Worksheet Functions 0 September 29th 06 03:15 PM
How do I bring back my worksheet tabs in Excel. Options doesn't Grenier Excel Worksheet Functions 2 May 21st 06 05:55 AM
Protect Workbook vs Worksheet?? Dan B Excel Worksheet Functions 3 November 7th 05 09:02 PM
Copy from worksheet to another x times Union70 Excel Discussion (Misc queries) 0 March 7th 05 09:03 PM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM


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