+ Reply to Thread
Results 1 to 9 of 9

UserForm with filtered data

  1. #1
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    UserForm with filtered data

    The attached has a very simple UserForm (a drastically simplified version of something I use at work). By using the spin button you can cycle through the records on the Data sheet.
    This all works great, however, when the data is filtered it falls over when you get to a record that's not showing due to the filter.

    So I'm looking for an elegant solution to get around this. Any ideas?

    Thanks in advance

    B
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: UserForm with filtered data

    Change your code for SpinButton1 to:

    Please Login or Register  to view this content.
    This should skip any filtered out values

    or if you wanted to include filtered-out values, instead change your TextBox1 change code to:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-28-2014
    Location
    harbin,china
    MS-Off Ver
    2007
    Posts
    162

    Re: UserForm with filtered data

    Here it is
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: UserForm with filtered data

    Thanks for that brokenbiscuits. It works, almost. It allows me to scroll forward through the rows but not backward.
    For example if I have references 222 and 444 hidden, the form starts at 111 and I can go to 333 and 555, but if I'm on 555 I cannot get back to 333 or 111.

    B

  5. #5
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: UserForm with filtered data

    Quote Originally Posted by simcode View Post
    Here it is
    Thank you simcode, but I need it not to show the filtered rows. Should have mentioned that in my original post. Apologies.

    B

  6. #6
    Forum Contributor
    Join Date
    09-28-2014
    Location
    harbin,china
    MS-Off Ver
    2007
    Posts
    162

    Re: UserForm with filtered data

    This time, the code is longer than before, but Textbox2 & Textbox3 will response to changing of Textbox1.
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,573

    Re: UserForm with filtered data

    Try
    Please Login or Register  to view this content.

  8. #8
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: UserForm with filtered data

    EDIT: Actually, this would still need some error-checking building in - I could do this, but far better to use simcode's alternative above as it's already working!

    Of course, complete oversight by me!

    You need to get rid of the SpinButton_Change and replace with:

    Please Login or Register  to view this content.
    Last edited by brokenbiscuits; 12-18-2015 at 09:05 AM.

  9. #9
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: UserForm with filtered data

    Thanks for the help everyone. Three great solutions there. :D

    B

+ 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. Filter sheet data with ComboBoxes, then Update UserForm with filtered sheet data
    By onmyway in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2015, 05:59 AM
  2. Populate a textbox on Userform with data from a filtered range using VBA
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-13-2014, 04:20 AM
  3. Userform to show filtered data
    By onsid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-23-2013, 02:56 PM
  4. [SOLVED] populate userform with filtered data
    By crossy5575 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-24-2012, 11:47 AM
  5. Load Userform ComboBox with filtered data
    By anandvh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-20-2012, 05:34 PM
  6. Filtered Data in userform
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2007, 03:46 AM
  7. Using Filtered Data in Userform Listbox
    By sfinney in forum Excel General
    Replies: 0
    Last Post: 03-18-2005, 11:09 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