Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Getting 1 list from 2 sheets | Excel Discussion (Misc queries) | |||
List Sheets excluding sheets named ***-A | Excel Discussion (Misc queries) | |||
Need to create a list of sheets from a list of names in column a | Excel Programming | |||
Name sheets from a list | Excel Programming | |||
List of Sheets | Excel Programming |