Results 1 to 6 of 6

Thread: Excel: name arrays

  1. #1

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Excel: name arrays

    Is it possible to have arrays of names for different ranges in Excel? The idea is I have 2 tables of the same size in different sheets and I would like to call them, say table(1) and table(2) so that calculations are performed with either table according to the selected value from a combobox.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  2. #2
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Excel: name arrays

    you could add a new name tot he worksheet that refers to either table(1) or table(2), dependant on the checkbox value.

    This is not easy to explain, so I've included an example.
    There are 2 base named ranges, TABLE1 and TABLE2.
    The checkbox is linked to another named range called TOGGLE_TABLE.
    Then I added a new name, called SELECTED_TABLE, with the following formula
    Code:
    =IF(TOGGLE_TABLE,TABLE2,TABLE1)
    This formula driven name will change its reference based on the checkbox value.
    Attached Files Attached Files
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  3. #3

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Excel: name arrays

    Yes, that's what I need but I thought maybe I could use the same name for all my tables. If some time in the future I need to add supplementary tables to the spreadsheet then arrays make it easier to implement. Or maybe, on second thoughts, your method is just as easy... Thanks!

    For now I won't mark the thread resolved yet, just in case someone may come up with an unexpected trick.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  4. #4
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Excel: name arrays

    You could dynamically change the value of the RefersToRange Property of the Name object.
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  5. #5

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Excel: name arrays

    Quote Originally Posted by DKenny
    You could dynamically change the value of the RefersToRange Property of the Name object.
    I'll take a look at this property...never used it before.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  6. #6

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Excel: name arrays

    Seems a promising possibility
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

Posting Permissions

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



Click Here to Expand Forum to Full Width