+ Reply to Thread
Results 1 to 4 of 4

transferring defined names from one worksheet to another via data connection?

  1. #1
    Registered User
    Join Date
    04-25-2013
    Location
    toronto
    MS-Off Ver
    Excel 2003
    Posts
    58

    transferring defined names from one worksheet to another via data connection?

    I have a workbook where I have defined a set of named variables. I have tried setting up a data connection to the worksheet. Once I have selected table (sheet) the entire data is transferred over but it is treated as one huge table. All the defined names are no longer on the new workbook.

    Is there any way that I can keep these defined names on another worksheet via data connection?

    Could this be achieved via other ODBC data connection schemes?

    Not only I like to have the data I would like to retrieve the defined data names so I can immediately refer to them on my new workbook

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: transferring defined names from one worksheet to another via data connection?

    Hello vientito,

    You can use ADO to retrieve the sheet names (tables), named ranges (defined names), and the data. This macro will let you select a workbook and show you the worksheet names and defined names as they would be used in an SQL Query. The macro assumes all names comply with standard database conventions (alphanumeric and underscores only) and the first row of each record contains filed names (column headers).
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 04-11-2014 at 06:00 PM.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    04-25-2013
    Location
    toronto
    MS-Off Ver
    Excel 2003
    Posts
    58

    Re: transferring defined names from one worksheet to another via data connection?

    I am also interested in copying the underlying definition of the named ranges. Say, on the remote excel sheet I have a named range called S1 that is defined by a dynamic formula. I would like this range and its definition to be duplicated exactly on my destination workbook. So in a word, I am not just interested in the data itself but the definition and variables of that remote workbook. I'd like a duplicate of that definition re-generated in my destination workbook, so I would be able to see, with opening of the name manager on the destination workbook, S1 with its associated definition. Is this achievable with some operation of ADO and excel vba?

    What my intention of this exercise is to store a configuration file at a central location. I am going to distribute a series of vba scripts to many users. When they start up their scripts the first thing to happen is to retrieve the configuration from my central configuration file and populate their own configuration sheet. Once that's done, everything referred to in the script (named range) are effectively there for the script to be acted on. This way I can change my configuration at will on my central master configuration sheet, without bothering to send off a new script (a different configuration) every single time.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: transferring defined names from one worksheet to another via data connection?

    ADO will not see dynamic named ranges. You would need to store a table of range names and their formulas, retrieve that information using ADO and then create the names in the target sheet from that data.
    Remember what the dormouse said
    Feed your head

+ 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. Delete nearly all defined names from the active worksheet only
    By kjjjjshab in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-16-2013, 08:39 PM
  2. Error in Index & Match Formula due to Defined Names Worksheet is Getting Changed!
    By Rajeshkumar R in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-11-2013, 08:37 AM
  3. Replies: 0
    Last Post: 04-12-2013, 07:38 AM
  4. VBA code to hide defined names in worksheet
    By lealea1982 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-05-2010, 06:01 AM
  5. Excel 2007 : How to view defined names on worksheet
    By STGE2 in forum Excel General
    Replies: 2
    Last Post: 09-01-2010, 10:00 AM

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