Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default Name all Sheets except first one from a list

Hi all, I have sheet names in Range("A3:A13") of Sheet1 and I have 11
sheets in a workbook. I want macro on a button which should give
names to all sheets except the first sheet or Sheet1 by looking in
Range("A3:A10") of Sheet1. Please can any friend can help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Name all Sheets except first one from a list

Sub NameWorksheets()
Dim intTemp
For intTemp = 2 To ActiveWorkbook.Sheets.Count
ActiveWorkbook.Sheets(intTemp).Name = ActiveWorkbook.Sheets(1).Range("A" &
intTemp + 1)
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"K" wrote:

Hi all, I have sheet names in Range("A3:A13") of Sheet1 and I have 11
sheets in a workbook. I want macro on a button which should give
names to all sheets except the first sheet or Sheet1 by looking in
Range("A3:A10") of Sheet1. Please can any friend can help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Name all Sheets except first one from a list

You need to have 10 sheet names
The range should be Range("A3:A12") and not Range("A3:A10")


If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Sub NameWorksheets()
Dim intTemp
For intTemp = 2 To ActiveWorkbook.Sheets.Count
ActiveWorkbook.Sheets(intTemp).Name = ActiveWorkbook.Sheets(1).Range("A" &
intTemp + 1)
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"K" wrote:

Hi all, I have sheet names in Range("A3:A13") of Sheet1 and I have 11
sheets in a workbook. I want macro on a button which should give
names to all sheets except the first sheet or Sheet1 by looking in
Range("A3:A10") of Sheet1. Please can any friend can help

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default Name all Sheets except first one from a list

On 2 Apr, 13:24, Jacob Skaria
wrote:
You need to have 10 sheet names
The range should be Range("A3:A12") and not Range("A3:A10")

If this post helps click Yes
---------------
Jacob Skaria



"Jacob Skaria" wrote:
Sub NameWorksheets()
Dim intTemp
For intTemp = 2 To ActiveWorkbook.Sheets.Count
ActiveWorkbook.Sheets(intTemp).Name = ActiveWorkbook.Sheets(1).Range("A" &
intTemp + 1)
Next
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"K" wrote:


Hi all, *I have sheet names in Range("A3:A13") of Sheet1 and I have 11
sheets in a workbook. *I want macro on a button which should give
names to all sheets except the first sheet or Sheet1 by looking in
Range("A3:A10") of Sheet1. Please can any friend can help- Hide quoted text -


- Show quoted text -


Hi jacob, Thanks for replying. sorry i didnt understant your answer.
basically i have 11 sheets in workbook and i want macro to name 10
sheets from range("A3:A12") leaving the sheet1
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Name all Sheets except first one from a list

K schrieb:
Hi all, I have sheet names in Range("A3:A13") of Sheet1 and I have 11
sheets in a workbook. I want macro on a button which should give
names to all sheets except the first sheet or Sheet1 by looking in
Range("A3:A10") of Sheet1. Please can any friend can help



Hi,
if you have names in A3:A13 that's 11 names
If your workbook has 11 sheets and you want to rename all but the first
one, you only have 10 sheets you want to rename. Why 11 names in 11 cells?

This should get you started (watch out for wordwrap):

For iSheetCounter = 2 to activeworkbook.Sheets.Count

Activeworkbook.Sheets(iSheetCounter).Name =
Worksheets("Sheet1").Cells(iSheetCounter+1,1).valu e

Next iSheetCounter

Hope this helps,
Dominik.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Name all Sheets except first one from a list

I have posted the answer in my first reply itself. I was mentioning that
instead of ("A3:A12") you have give ("A3:A10").....Try this and feedback.

Sub NameWorksheets()
Dim intTemp
For intTemp = 2 To ActiveWorkbook.Sheets.Count
ActiveWorkbook.Sheets(intTemp).Name = ActiveWorkbook.Sheets(1).Range("A" &
intTemp + 1)
Next
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"K" wrote:

Hi all, I have sheet names in Range("A3:A13") of Sheet1 and I have 11
sheets in a workbook. I want macro on a button which should give
names to all sheets except the first sheet or Sheet1 by looking in
Range("A3:A10") of Sheet1. Please can any friend can help

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
Getting 1 list from 2 sheets txheart Excel Discussion (Misc queries) 3 July 6th 11 05:24 PM
List Sheets excluding sheets named ***-A Dolphinv4 Excel Discussion (Misc queries) 1 December 15th 07 09:29 AM
Need to create a list of sheets from a list of names in column a KC Rippstein Excel Programming 0 December 7th 06 08:15 PM
Name sheets from a list deeds Excel Programming 5 September 18th 06 06:29 PM
List of Sheets Dnk Excel Programming 0 April 1st 04 02:59 PM


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