+ Reply to Thread
Results 1 to 5 of 5

extend a named range with VBA

  1. #1
    Registered User
    Join Date
    07-15-2014
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    3

    extend a named range with VBA

    Hi,

    I have to "develop" a new time management excel solution for our departement and facing some problems (VBA - beginner). I am using a userform as interface and would like to add new items based on a textbox value and command button click to a named range.
    Let's say I have a sheet called "Konfiguration" and in column "C" is a header (KE Mitarbeiter") and below are 2 existing employees. How can I add a new employee so the dynamic range (name is "KEM") will be extended and sort alphabetically?

    This list is going to be a rowsource for several comboboxes.

    Thank you in advance
    Moritz

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: extend a named range with VBA

    Create a dynamic named range (I named this one KEM), something like:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Now in the worksheet module, enter:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    07-15-2014
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    3

    Re: extend a named range with VBA

    Think you got me wrong. I would like to use a userform with a textbox and a command button. You can enter a new employee into the TextBox and when you click the command button the named should be added to the list. The userform is created with VBA. (ALT + F11)

    I attached a simplified sheet for better understanding


    ---> demo.xlsm

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: extend a named range with VBA

    Always easier with a workbook.

    It's a table, not a named range. So try:
    Please Login or Register  to view this content.
    Does THAT do what you want?

  5. #5
    Registered User
    Join Date
    07-15-2014
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    3

    Re: extend a named range with VBA

    GREAT!

    Thank you very much

+ 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. Adding row to a named range-updating the named range address
    By kjsconv in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-12-2013, 11:22 PM
  2. Replies: 1
    Last Post: 02-27-2013, 12:00 AM
  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. [SOLVED] HOW TO EXTEND A NAMED RANGE
    By ramana in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-26-2005, 04:05 AM
  5. [SOLVED] Painting Range - extend the range on the top part
    By Shrikant in forum Excel General
    Replies: 4
    Last Post: 09-01-2005, 07:05 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