+ Reply to Thread
Results 1 to 15 of 15

Create a named range of cells BUT variable in reference to a cell value

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Create a named range of cells BUT variable in reference to a cell value

    I know how to name a cell or a range of cells (name is changed at the upper-left corned, beside the formula bar)... however this is a manual process.
    Is there a way to make this variable and change dynamically? have the name referenced to a cell value?

    Thanks!

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Create a named range of cells BUT variable in reference to a cell value

    Hi,

    Can you give a more specific example, including the cells in question and what your desired result would be?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    01-22-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Cool Re: Create a named range of cells BUT variable in reference to a cell value

    Check the attached file.
    DemoBook1.xlsx

    Want to name column-D with the corresponding name in column-A.
    • Currently I only know how to do it manually (select the column-D, click on the NameBox at the left of the formula bar, and type the name manually).
    • I would like it to be assigned dinamically... hence, if the values under column-A change, so does the name range.

    Thanks i advance for your help!

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Create a named range of cells BUT variable in reference to a cell value

    Hi again,

    When you say you want to "name column-D with the corresponding name in column-A" what precisely do you mean? What is the "correspondence" here? Is D1 supposed to "correspond" to cell A2 in some way, and E1 to A3?

    "if the values under column-A change, so does the name range."

    That's not a problem, and quite usual, to set dynamic, offset ranges which will respond to changes in those ranges. But your original request seemed to be suggesting rather that you wanted the actual names of the Named Ranges to change, and I'm not sure what you mean exactly by that, nor why you'd particularly want it.

    Regards

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,585

    Re: Create a named range of cells BUT variable in reference to a cell value

    Pl see attached file.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-22-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Create a named range of cells BUT variable in reference to a cell value

    XOR LX... thanks for the support.

    I believe I made a poor job at explaining myself, hahaha!! Check the attached picture, please.
    now I realize that the cells D1:J1 are causing a confussion... those are just labels for the columns.
    What I'd like to do is Naming the column (hope the attached picture makes sense).

    RangeName1.jpg
    RangeName2.jpg

    Thanks!!
    Last edited by peponfree; 02-11-2014 at 12:23 PM.

  7. #7
    Registered User
    Join Date
    01-22-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Create a named range of cells BUT variable in reference to a cell value

    Not what I'm looking for, I apologize for not being clear myself... please check on my previous reply where I attach some pictures with what I need.
    Thanks for your help.

    Quote Originally Posted by kvsrinivasamurthy View Post
    Pl see attached file.

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Create a named range of cells BUT variable in reference to a cell value

    May I ask why you want to change the name? Sounds like quite an unusual request, I have to say, especially since you don't appear to be interested in changing any actual values within those ranges. Or am I missing something?

    Regards

  9. #9
    Registered User
    Join Date
    01-22-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Create a named range of cells BUT variable in reference to a cell value

    Always the "why" is the most important question... ;-)
    • I'm creating a basic "customer contacting log" tool to keep track of the interaction between a supplier and its clients.
    • I want to create two data validation drop-down fields (somewhere else in the workbook).
    • One will show the company names (referring to Column A) and the second one will show only the contacts in those companies... that will be part of a Call-Log and will have thereafter other fields such as "date" and "purpose of the call".
    • The second data validation drop-down will have an "indirect(NameRange)" formula tied to the resulting name from the first drop-down one (in this case the value of N2)... and THAT's why I need to have the columns Named.
    • Please see the attached picture for a basic view.
    RangeName3.png

    The Company and Contacts will come from another table (kind of flat log style).
    Table on C1:J6 is already a byproduct of those flat tables.

    I'm trying of making everything as non-manual as possible.
    Last edited by peponfree; 02-11-2014 at 01:38 PM.

  10. #10
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Create a named range of cells BUT variable in reference to a cell value

    No, still totally confused I'm afraid!

    Why can't you just create your multiple Named Ranges (seven in your example: Company01 to Company07) so that e.g. Company01 is D2:D6, Company02 is E2:E6, etc. (these can be made to be dynamically offset depending on the number of names in each column)?

    So then N2 is a drop-down list containing these Named Ranges and N3 lists the Contacts for whichever Named Range is selected in N2.

    If that's not what you want, then I apologise but I can't see what else it could be.

    Regards

  11. #11
    Registered User
    Join Date
    01-22-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Create a named range of cells BUT variable in reference to a cell value

    Then... could you show me how to do what you're suggesting?
    (perhaps my method is not the most efficient + I'm not familiar with the offset... the multiple named ranges need to be created dynamically as the number of companies will also grow)

    At the end, I need (the end-user) to be able to drop-down select the company and then have the second drop-down to only show the contacts belonging to that company.
    FYI... here's the draft file DemoBook1.xlsx

    Thanks for your patience!
    Last edited by peponfree; 02-11-2014 at 04:05 PM.

  12. #12
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Create a named range of cells BUT variable in reference to a cell value

    Ok, but you already seem to have the correct drop-down set-up with your INDIRECT. So I'm assuming that bit's ok and that you just need to make each range dynamic in case of additions/deletions?

    Regards

  13. #13
    Registered User
    Join Date
    01-22-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Create a named range of cells BUT variable in reference to a cell value

    Exactly.
    I'm stuck on the part of making each range dynamic.

    Thanks much!

  14. #14
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Create a named range of cells BUT variable in reference to a cell value

    But then this is precisely what kvsrinivasamurthy gave you in Post #5. Can you please clarify your reply in Post #7?

    Regards

  15. #15
    Registered User
    Join Date
    01-22-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Cool Re: Create a named range of cells BUT variable in reference to a cell value

    Sorry for the late response...

    my problem resides in dynamically "naming" the columns so I can refer to them later in another formula. By dynamically I mean: use a formula or VBA code line... and not doing it manually either on the box at the left of the formula bar or using the "Name Manager" at the formula ribbon.

    In the example attached here:
    • I had to manually name the columns D to J as "Company01" to "Company07" (I selected and named the whole column.
    • You can see that the first drop-down in N3:N8 brings values that correspond to the column names (because I use the same names in A2:A8)
    • the second drop-down at O3:O8 perform an "indirect(column_name)" to it and bring the values under that named column.
    • what's the problem? everytime there's a new Company created, I may need to manually name the column to than new Company.
    • If that can be automated, the ideal would be to have new Companies growing from columns K to the right, BUT each column named.
    • the values under the columns (the contact names) are not an issue, those will be populated.

    The example that very kindly was provided in post #5 helps me with the ranging on the drop-down (which I find very useful, btw)... but still requires to manually name the ranges.

    DemoBook1-1.xlsx
    RangeName4.png

    Hope this was a bit more explanatory.

  16. #16
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Create a named range of cells BUT variable in reference to a cell value

    Hi,

    I think I'm understanding a bit better now.

    Have you tried the Create from Selection (Formulas/Name Manager) option? For example, if you insert a new row above your current names, and enter the desired Company Names, then highlight D1:J6 (or however many rows is necessary) and use Create from Selection with just the Top row box checked, then all those required Named Ranges are automatically generated.

    Hope that helps?

    Regards

  17. #17
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Create a named range of cells BUT variable in reference to a cell value

    Hi,

    I think I'm understanding a bit better now.

    Have you tried the Create from Selection (Formulas/Name Manager) option? For example, if you insert a new row above your current names, and enter the desired Company Names, then highlight D1:J6 (or however many rows is necessary) and use Create from Selection with just the Top row box checked, then all those required Named Ranges are automatically generated.

    Hope that helps?

    Regards

+ 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] Create a named range based on cell value using a variable in VBA
    By ker9 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-14-2012, 12:11 PM
  2. [SOLVED] Using a formula to create named range reference
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-06-2005, 06:05 AM
  3. Using a formula to create named range reference
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 04:05 AM
  4. Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  5. Replies: 0
    Last Post: 09-06-2005, 12:05 AM

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