Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have several sheets in the same workbook (e.g. year1, year2, year3,...).
I would like to name the same range in every sheet by the same name (e.g. salesmonth1) Is there a way to do this "in one move", I mean without going from sheet to sheet. Thanks in advance Gilbert |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If you were interested in doing this programmatically, you could do
something like this: Dim i As Long For i = 1 to Worksheets.Count Worksheets(i).Names.Add Name:="salesmonth1", RefersToR1C1:= "=" & Worksheets(i).Name & "!R5C2:R18C5" Next i In the end, cells B5:E18 of each worksheet would be named "salesmonth1" --JP On Nov 26, 3:03 am, "Gilbert DE CEULAER" wrote: I have several sheets in the same workbook (e.g. year1, year2, year3,...). I would like to name the same range in every sheet by the same name (e.g. salesmonth1) Is there a way to do this "in one move", I mean without going from sheet to sheet. Thanks in advance Gilbert |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On mo
Option Explicit Sub testme() Dim iCtr As Long Dim wks As Worksheet iCtr = 0 Do iCtr = iCtr + 1 Set wks = Nothing On Error Resume Next Set wks = Worksheets("year" & iCtr) On Error GoTo 0 If wks Is Nothing Then Exit Do End If wks.Range("A1:b99").Name = "'" & wks.Name & "'!salesmonth1" Loop End Sub Gilbert DE CEULAER wrote: I have several sheets in the same workbook (e.g. year1, year2, year3,...). I would like to name the same range in every sheet by the same name (e.g. salesmonth1) Is there a way to do this "in one move", I mean without going from sheet to sheet. Thanks in advance Gilbert -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
comparing 2 sheets with a range | Excel Discussion (Misc queries) | |||
INDIRECT for range of sheets | Excel Worksheet Functions | |||
Referencing a Range of Sheets | Excel Discussion (Misc queries) | |||
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? | Excel Worksheet Functions | |||
Common range name for 2 sheets | Excel Discussion (Misc queries) |