+ Reply to Thread
Results 1 to 5 of 5

Copying worksheets, to inherit named ranges from destination workbook?

  1. #1
    Registered User
    Join Date
    04-18-2007
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    36

    Copying worksheets, to inherit named ranges from destination workbook?

    Firstly I just wanted to say a big thanks to all contributors on this forum, I only come here when I need help and I'm always blown away by how keen and helpful folks are. I wish I could pay it forward by helping out other users, but you know what they say about bringing a knife to a gunfight...

    Anyway, today's problem is about worksheets and named ranges.

    I have several workbooks that are essentially the same, just with different data. They all use the same named ranges.

    I need to add a new worksheet to all of them, which is a summary page for printing. I have created the first one and done lots of layout and formatting work, with custom headers and footers for printing. I'd like to just copy this worksheet into the other workbooks, along with all its formatting, but when I do it is unable to find the relative data in the destination workbook.

    The problem is particularly annoying because according to the formulae, it IS looking for things in the right place. The issue is obviously the named ranges - where IT thinks "RANGE1" is, isn't where I think "RANGE1" is.

    Is there a way to copy a worksheet and its formatting into a new workbook, and get it to use the named ranges in the recipient workbook rather than the donor?

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Copying worksheets, to inherit named ranges from destination workbook?

    How have you defined the named ranges and what scope do they have?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    04-18-2007
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Copying worksheets, to inherit named ranges from destination workbook?

    The ranges are generally all of the columns in a given sheet, given a name like "STOCKDATA". Subsequent sheets find the data they need by using (eg) "=VLOOKUP(A1,STOCKDATA,2,FALSE)".

    Does this answer your question?

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Copying worksheets, to inherit named ranges from destination workbook?

    Partly, what I really wanted to find out was whether the scope of the named range was workbook or worksheet level.

    As far as I know when you copy a worksheet any named ranges with worksheet scope will refer to the new worksheet instead of the original worksheet.

  5. #5
    Registered User
    Join Date
    04-18-2007
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Copying worksheets, to inherit named ranges from destination workbook?

    I have no idea about scope, it isn't something I have set so I'm sure it would just be whatever the default behaviour is for Excel 2007. I just select all columns then give it a name in the name box, and that's my named range.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. copying similar named worksheets from multiple workbooks into a master workbook
    By bradpeh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-24-2013, 04:41 AM
  2. Copying and pasting Named (Dynamic) Ranges from one workbook to the other
    By Let in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-23-2012, 10:06 AM
  3. [SOLVED] Copying ranges of cells from different worksheets in a workbook based on an if then
    By stinkybottom in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-13-2012, 09:19 PM
  4. supress prompt for named ranges when copying sheet to new workbook
    By neowok in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2006, 02:00 PM
  5. [SOLVED] named ranges and copying sheets to another workbook
    By helpwithXL in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-17-2005, 12:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1