+ Reply to Thread
Results 1 to 3 of 3

Automatically answer Named Conflict Dialog with No and set Named range to variable

  1. #1
    Registered User
    Join Date
    10-04-2012
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    18

    Automatically answer Named Conflict Dialog with No and set Named range to variable

    Hello,

    I am having trouble handling the named range conflict box within a worksheet I am producing. Essentially, I have a master set of 4 worksheets. One worksheet is more or less the "Data" and there are several named ranges on this sheet. The other three sheets are a series of summaries with formulas referencing the "Data" sheet. The macro I'm writing is designed to create a copy of the four tabs within the same workbook. The user can then customize the other tabs as needed to get a different view. The problem that I'm having is with the named Range conflict box. When manually copying the set, I would select "No" from the dialog box and then enter my new name for the new sheets then the new summary sheets will only reference the "Data" sheet that was just created. However there are about 25 named ranges, so this process is tedious and the main reason for developing the macro. I'm looking for a way to automate the Copy/paste of tabs and then to also us a single input box to rename all of the new copied named ranges into the new tabs. I've created a very simple example file with some simple code (in CopySheets Module) that demonstrates the issue. The idea would be to click the "Copy Sheets" button on Tab 3 and bypass the error but default to "No" on the dialog box rather than "yes". Let me know if there is anything unclear about the way I've described this, or if there is any other information needed for the issue.

    Thanks in advance for your help!!

    Thanks,
    Mike

    NamedRangeExample.xlsb

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Automatically answer Named Conflict Dialog with No and set Named range to variable

    I think you can avoid the named range trap by using Worksheet-level-names, instead of Workbook-level-names, and referencing them specifically.
    Then when you create copies of the worksheets, they carry their range names with them.

    See that attached file.

    Does that help?
    Attached Files Attached Files
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    10-04-2012
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Automatically answer Named Conflict Dialog with No and set Named range to variable

    Hey Ron,

    Thanks for the quick response!

    This is one of those moments where I'm not sure why I didn't think of that! Always gotta remember that sometimes the simplest answer is the right answer and not everything needs to be a VBA solution!

    Thanks,
    Mike

+ 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. [SOLVED] Determining if the value of a cell can be a named range, then assigning named ranges after
    By Romulo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-15-2013, 06:05 PM
  2. Array formulas referencing a named range or named table
    By anrichards22 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-03-2013, 11:59 PM
  3. [SOLVED] Determine what Named Range the Target Address is and return Named Range Name
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-18-2012, 10:49 PM
  4. Looking up against a variable named range??
    By jghutch in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-25-2006, 08:26 PM
  5. [SOLVED] Named ranges-is there a an easy way to reference a single value in a named range?
    By pspkim@gmail.com in forum Excel General
    Replies: 1
    Last Post: 03-21-2006, 06:40 PM

Tags for this Thread

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