Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default Same Name Range for different spreadhseets in a workbook

In previous Excel versions I was able to define a constant in a Name and
assign it to a specific spreadsheet. This is for VBA coding which defines
the action based on the type of spreadsheet that is active. I cannot assign
a spreadsheet specific Name constant within Excel 2003 unless I am missing
something. Attempted to use the Name Add-in Manager from this site but
receive an "On-Click" error so the add-in will not load.

How do I assign the same Name Range to specific spreasheets. For example, I
need a Name Range for every spreadsheet with in the workbook entitled
"SheetType" each spreadsheet will have a different constant assigned to that
Name.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Same Name Range for different spreadhseets in a workbook

Mark,

Don't have 2003 so I cannot be sure, but I would be surprised if this were
not possible. Did you create it like so

worksheets("Sheet2").Range("A1").Name = "Sheet2!Bob"

and Sheet1, etc.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mark" wrote in message
...
In previous Excel versions I was able to define a constant in a Name and
assign it to a specific spreadsheet. This is for VBA coding which defines
the action based on the type of spreadsheet that is active. I cannot

assign
a spreadsheet specific Name constant within Excel 2003 unless I am missing
something. Attempted to use the Name Add-in Manager from this site but
receive an "On-Click" error so the add-in will not load.

How do I assign the same Name Range to specific spreasheets. For example,

I
need a Name Range for every spreadsheet with in the workbook entitled
"SheetType" each spreadsheet will have a different constant assigned to

that
Name.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Same Name Range for different spreadhseets in a workbook

Hi Mark,

In previous Excel versions I was able to define a constant in a Name and
assign it to a specific spreadsheet. This is for VBA coding which defines
the action based on the type of spreadsheet that is active. I cannot assign
a spreadsheet specific Name constant within Excel 2003 unless I am missing
something. Attempted to use the Name Add-in Manager from this site but
receive an "On-Click" error so the add-in will not load.


Could you send the error message to the address listed on my website please?

How do I assign the same Name Range to specific spreasheets. For example, I
need a Name Range for every spreadsheet with in the workbook entitled
"SheetType" each spreadsheet will have a different constant assigned to that
Name.


Precede the name with the name of the worksheet. If e.g. the worksheet is named
Sheet 1 and the name is Name01, use this name:

'Sheet 1'!Name01

as the name of the name.

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Same Name Range for different spreadhseets in a workbook

Another way via code:

Option Explicit
Sub testme()
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
With wks
.Names.Add Name:="MyRng", RefersTo:=.Range("a1:b9")
End With
Next wks
End Sub



Mark wrote:

In previous Excel versions I was able to define a constant in a Name and
assign it to a specific spreadsheet. This is for VBA coding which defines
the action based on the type of spreadsheet that is active. I cannot assign
a spreadsheet specific Name constant within Excel 2003 unless I am missing
something. Attempted to use the Name Add-in Manager from this site but
receive an "On-Click" error so the add-in will not load.

How do I assign the same Name Range to specific spreasheets. For example, I
need a Name Range for every spreadsheet with in the workbook entitled
"SheetType" each spreadsheet will have a different constant assigned to that
Name.


--

Dave Peterson
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
Merging data from several Excel 2010 spreadhseets Bob[_20_] Excel Discussion (Misc queries) 5 October 15th 11 02:17 PM
Merging data from several Excel 2010 spreadhseets Bob[_20_] New Users to Excel 5 October 15th 11 02:17 PM
Help: vlookup from multiple sheets and spreadhseets Mr Fujisawa[_2_] Excel Worksheet Functions 1 March 16th 10 08:11 PM
Match data of two identical strings in two separate spreadhseets Mahendra Excel Discussion (Misc queries) 0 September 14th 05 11:40 PM
why do check boxes move when printing excel spreadhseets Simon Jefford Excel Discussion (Misc queries) 3 June 22nd 05 02:04 PM


All times are GMT +1. The time now is 08:36 PM.

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"