+ Reply to Thread
Results 1 to 7 of 7

removing blank at bottom of dynamic named range

  1. #1
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    removing blank at bottom of dynamic named range

    In my combo boxes where they are populated with a dynamic named range, there is an blank space at the bottom. On my combo boxes populated with my named ranges (not dynamic), there is no space - so I'm thinking my formula in my name manger may not be quite right.

    For one dynamic range, the range begins in B2, and continues the next cell down column B for an unspecified number of cells. For Range1, for example, the formula in the name manger is:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    How do I get it to remove the blank when this range is called?

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex
    MS-Off Ver
    365
    Posts
    5,503

    Re: removing blank at bottom of dynamic named range

    Try using the below to define your dynamic range:

    =Worksheet2!$B$2:INDEX(Worksheet2!$B:$B,COUNTA(Worksheet2!$B:$B))

  3. #3
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: removing blank at bottom of dynamic named range

    Nope... I did try that just in case, but I think the '1' at the end is the syntax for the OFFSET formula is the Width (# of columns), which in my case, should be left at 1 for only a single column. Thanks though!

    It could be the in the way my VBA code populates the combo box, but I thought I'd try here first.

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex
    MS-Off Ver
    365
    Posts
    5,503

    Re: removing blank at bottom of dynamic named range

    Personally I would always use the INDEX approach to dynamic ranges over OFFSET as the latter is volatile and therefore recalculates at every change.

    As for your specific issue with the one blank in your list, perhaps it would be easier to solve if you posted a workbook. Make sure it's sanitised of sensitive information.

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,072

    Re: removing blank at bottom of dynamic named range

    In the COUNTA portion, are you counting the headers or some other input? If so, then subtract 1 from that portion or change the range (i.e. B2:B500). If it is consistently off by 1, even if you can't figure it out, you can fix it with the

    COUNTA('Worksheet2'!$B:$B)-1
    ChemistB
    My 2

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  6. #6
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: removing blank at bottom of dynamic named range

    @BadlySpelledBuoy

    I totally missed that you used INDEX and not OFFSET - my bad... still didn't work (though it my not be the formula per se, as I got some weird VBA errors).

    @ChemistB

    I'll try that...

  7. #7
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: removing blank at bottom of dynamic named range

    Quote Originally Posted by ChemistB View Post
    In the COUNTA portion, are you counting the headers or some other input? If so, then subtract 1 from that portion or change the range (i.e. B2:B500). If it is consistently off by 1, even if you can't figure it out, you can fix it with the

    COUNTA('Worksheet2'!$B:$B)-1
    It may be counting the header in Row 1, as the OFFSET formula specified '$B$2' but the COUNTA formula just said '$B' ...anyway, this worked:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Thanks.

+ 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. Dynamic named range that ignores formulas that return blank
    By Nils88 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-27-2013, 05:02 AM
  2. Replies: 1
    Last Post: 12-16-2011, 08:08 PM
  3. My Dynamic Named Range brings up blank rows?!
    By LiamPotter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2008, 10:42 AM
  4. Dynamic named list includes blank cell at bottom
    By L Scholes in forum Excel General
    Replies: 1
    Last Post: 04-13-2006, 01:20 PM
  5. Dynamic Named Range with blank cells
    By tjtjjtjt in forum Excel General
    Replies: 3
    Last Post: 10-05-2005, 04:05 PM

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