+ Reply to Thread
Results 1 to 3 of 3

To use name manager or create dynamic ranges in VBA

  1. #1
    Forum Contributor
    Join Date
    12-14-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    106

    To use name manager or create dynamic ranges in VBA

    Hi. I currently have a userform that requires information from changing lists. I have defined the named ranges so far with

    Please Login or Register  to view this content.
    This works fine and ignores the fact if a cell is missing in the data. However I have read that this is bad practice to define dynamic ranges in vba and It slows code down the code(no idea if either of these statements is true). The alternative appears to be to use the name manager and type in

    Please Login or Register  to view this content.
    In my opinion this is the weaker option because if I accidentally delete a cell within row C the count will be one less and as such the bottom cell may have an input that is not captured within the range. Is there a workaround for this or if this method is used is it a case of make sure there are no gaps in the data?

    APpreciate any comments on whether either of these methods are considered standard practice or if an laternative is preferred.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: To use name manager or create dynamic ranges in VBA

    If you are just using code to define a range, then it would be best to use the offset formula. Then you wouldn't have to save it as a macro enabled workbook as well.
    If you are using other code, then why not use the defined range code.
    The code is very efficient, it just finds the last used cell in a column, it will not slow down the program.

    More on defined ranges.
    http://support.microsoft.com/kb/830287

  3. #3
    Forum Contributor
    Join Date
    12-14-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: To use name manager or create dynamic ranges in VBA

    Many thanks Dave and cheers for the link. Will be using macros in my workbook so will stick with option 1

+ 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. Having many dynamic ranges in Name Manager
    By gogita in forum Excel General
    Replies: 0
    Last Post: 09-05-2013, 04:26 AM
  2. How to create dynamic ranges, better alternative to OFFSET
    By JamesGoulding85 in forum Excel General
    Replies: 2
    Last Post: 06-04-2013, 03:27 PM
  3. [SOLVED] Create Multiple Dynamic Named Ranges with a Macro
    By bennank in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-09-2012, 12:55 PM
  4. macro to create pie chart based on dynamic ranges
    By jarssonn in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-04-2010, 11:00 AM
  5. [SOLVED] Can you create dynamic named ranges containing array formulas?
    By Marie J-son in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-28-2006, 09:10 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