+ Reply to Thread
Results 1 to 6 of 6

Updating a Named range Automatically

Hybrid View

  1. #1
    rob_parkhill
    Guest

    Updating a Named range Automatically

    I was hoping that someone could give me some direction.

    I have a named range that I want to expand as the user adds more
    records. The records will be added one or two at a time over a span of
    months. I use the named range in a cobo-box on a user form. I will
    eventually be using the user selection to match back to records in the
    file (although a different worksheet)

    Is there an easy way to automatically update the named range every time
    I run the macro?

    I don't have any coding to share yet, although I am working through it.

    Thanks for any help.

    Rob


  2. #2
    aidan.heritage@virgin.net
    Guest

    Re: Updating a Named range Automatically

    Make the named range dynamic

    eg

    =A1:offset(a1,counta(a:a)-1,0)

    would give you all records in column A


  3. #3
    rob_parkhill
    Guest

    Re: Updating a Named range Automatically

    Aidan,

    Thanks for the assistance. When I make the named range dynamic though,
    it is just selecting a huge range, not what I am looking for. I want
    to select 2 columns and right now 30 rows starting at G5... so G5:H35
    (that's how the range is defined now). I will want the rnage to be
    defined from G5 until G has no values in it. i.e. the named range will
    stop if the column G and row X is null.

    Thanks,

    Rob


  4. #4
    aidan.heritage@virgin.net
    Guest

    Re: Updating a Named range Automatically

    A dynamic range such as this should do EXACTLY what you want, and is
    what I use reguarly on (for example) pivot tables that I want to read
    from an uncertain data range

    it may help to email me and I can send you an example file - my email
    is aidan.heritage@virgin.net


  5. #5
    rob_parkhill
    Guest

    Re: Updating a Named range Automatically

    I have the named range working and automatically updating, but the
    updating doesn't occur in the macro. I make a change to increase the
    size of the named range, but the combo box that is referencing the
    named range doesn't include the changes. The only way that I can make
    it update seems to be if I select the combo box and then select the Row
    Source location.. I can then save the userForm and run it, and the list
    is complete again.

    I need to be able to automatically update this, as I don't want users
    not seeing the newly added names to the named range.

    Thanks,

    Rob


  6. #6
    aidan.heritage@virgin.net
    Guest

    Re: Updating a Named range Automatically

    I'm assuming that the macro updates the data in the range, so at this
    point it can reference the combobox - with another one of the bits of
    code that looks a bit silly -

    ComboBox1.RowSource = ComboBox1.RowSource


    this will cause the data to refresh.


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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