+ Reply to Thread
Results 1 to 2 of 2

Show filtered records in userform

  1. #1
    Registered User
    Join Date
    08-26-2020
    Location
    Indiana
    MS-Off Ver
    2010
    Posts
    1

    Show filtered records in userform

    attached is my spreadsheet. Selecting a field from the first listbox fills the second listbox. Selecting from the second listbox filters the spreadsheet. How do I show only filtered records in my form? I've tried several things (you can see my mess commented out under Sub FillTextBoxes). I'd like to loop through them with the next and previous buttons, and edit and save them like I do unfiltered records.
    Attached Files Attached Files

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,176

    Re: Show filtered records in userform

    Hi Clara

    Welcome to the Forum...

    When initially designing ones Form, one should always create the Text Boxes in order of the Column Headers within spreadsheets...
    This way one can loop through textboxes and easily populate from Sheet...Col A vs TextBox1, Col B vs TextBox2 etc etc...
    Ideally...I prefer keeping textbox names as default...once again allowing easy loop option...
    Accordingly when writing back to sheet, one can easily resize range and populate at once without a loop...
    By renaming the Textboxes, as you did, you started off by giving them the same names as Column Headers which could have worked if you did this for all the TextBoxes...sadly, this is not the case...You could then have looped TextBox controls and matched them with the Header names...

    As you have just started, I suggest going back to the drawing board to amend to one of the following above suggestions...

    If not, the only way I see this working is Storing all TextBox names in Array, All corresponding Columns in Array - same order as textboxes, and then loop and populate accordingly...

    This will give you an idea...have changed first 4 columns of sheet and TextBoxes...

    Please Login or Register  to view this content.
    Check Torachan Posts...He has a few examples listed for members...
    Attached Files Attached Files
    Last edited by sintek; 08-27-2020 at 03:50 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

+ 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. [SOLVED] How to filter a table using textbox and show filtered data in listbox (userform)
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-01-2017, 10:31 AM
  2. [SOLVED] UserForm : Show records only greater than 0(zero) Solved by : Naveed Raza
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-01-2014, 01:15 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. show some excel records on excel vb Userform
    By sunil.excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-11-2013, 06:09 AM
  5. [SOLVED] Userform Previous Next Buttons to Show Only Filtered Records?
    By cindy71 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-12-2012, 10:38 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