+ Reply to Thread
Results 1 to 5 of 5

Listbox referring to hidden range

  1. #1
    Forum Contributor
    Join Date
    08-04-2013
    Location
    Bucharest
    MS-Off Ver
    Office Professional Plus 2019
    Posts
    303

    Listbox referring to hidden range

    I have this code for a texbox to search into a listbox
    It's working properly but sometimes it doesn't look at all the names in the list.. probably because some of the rows are hidden?

    Please Login or Register  to view this content.
    I think the solution will be for the Rows.Count to also look at hidden rows.
    Or I can try to move the name list to another sheet and make the code refer to that, but I could not find the proper way to make it look at Sheets("Sheet2") and AC column, for example.
    Thanks for your time.

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Listbox referring to hidden range

    Hidden cells should be included in the array, and would therefore be included in the listbox... Unless they are the last rows in the data range. One workaround is to change the below code:

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    Let me know if that works

  3. #3
    Forum Contributor
    Join Date
    08-04-2013
    Location
    Bucharest
    MS-Off Ver
    Office Professional Plus 2019
    Posts
    303

    Re: Listbox referring to hidden range

    Actually I have found a kind of fix, in listboxt properties, if I set TopIndex to 1, everything is fine and dandy.
    I have tried including ListBox1.TopIndex = 1 into the code but it gives an error.
    And still the problem is that the setting isnt' saved.. I have to set Topindex to 1 everytime I open the sheet.
    I will try what you suggested thanks!

  4. #4
    Forum Contributor
    Join Date
    08-04-2013
    Location
    Bucharest
    MS-Off Ver
    Office Professional Plus 2019
    Posts
    303

    Re: Listbox referring to hidden range

    BigBas - it seems to be working, thanks and + rep!

  5. #5
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Listbox referring to hidden range

    Not a problem. And thanks for the + rep!

+ 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. Replies: 0
    Last Post: 01-15-2014, 05:17 PM
  2. referring to selected values from listbox that filters pivottable
    By Datas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-14-2013, 02:37 PM
  3. [SOLVED] Indexing proper range in listbox depending on selection in previous listbox
    By bloodmeat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2013, 02:31 PM
  4. [SOLVED] Referring to a range
    By Alexander_Golinsky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-25-2012, 04:28 PM
  5. Hidden/Visible sheets in listbox
    By DRoberts in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2009, 08:18 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