Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default create named range specific to worksheet

Suppose I have a named range "x" in cell A1 of worksheet Sheet1, and I
copy the contents of Sheet1 to Sheet2. When I then write a formula on
Sheet2, "x" still refers to Sheet1!A1, when I want it to refer to
Sheet2!A2. In other words, I want each sheet copied from Sheet1 to have
its own set of named ranges, defined on that sheet. Can this be done?
Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default create named range specific to worksheet

Worksheets("Sheet2").Range("A1").Name = "Sheet2!X"

creates a sheet level name of X
--
Regards,
Tom Ogilvy

wrote in message
oups.com...
Suppose I have a named range "x" in cell A1 of worksheet Sheet1, and I
copy the contents of Sheet1 to Sheet2. When I then write a formula on
Sheet2, "x" still refers to Sheet1!A1, when I want it to refer to
Sheet2!A2. In other words, I want each sheet copied from Sheet1 to have
its own set of named ranges, defined on that sheet. Can this be done?
Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default create named range specific to worksheet

Sub makename()
ActiveSheet.Range("a1").Name = ActiveSheet.Name & "X"
End Sub

This is universal for all sheets. Unfortunately for you it is not
possible to have two or more ranges with same name within one workbook.
You can solve this by replacing e.g. sheet1x by sheet2x in your
formulas afer copying.

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
Referring to specific cell in named range in Excel formula Nigel Barton Excel Worksheet Functions 3 August 18th 09 04:25 PM
Defining Named Range for Lastrow in a specific column Barb Reinhardt Excel Discussion (Misc queries) 5 May 9th 07 08:55 PM
Selecting specific row/column from a named range [email protected] Excel Worksheet Functions 2 November 16th 05 09:24 PM
How do I count a named range for a specific word or acronym? brandyb Excel Worksheet Functions 1 November 4th 05 07:50 PM
named range not specific to worksheet Mark Kubicki Excel Programming 1 November 26th 03 04:39 PM


All times are GMT +1. The time now is 09:39 PM.

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"