+ Reply to Thread
Results 1 to 16 of 16

Click a button then user is asked what qty to filter or hide rows based on user input

  1. #1
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Click a button then user is asked what qty to filter or hide rows based on user input

    My data is in A2 to Z500. Column A, stating at A2 to A500 are numeric amounts representing quantities. I'd like to have a "Button" or such in cell A1 when clicked the user would be prompted "What quantities would you like removed from the list?" Based on what number the user enters, those rows would be hidden.

    A bonus would be then in cell B1 a note would appear "Rows with quantities xx are now Hidden"

    Thanks fro any direction - not too complicated solution hopefully.

    -j

  2. #2
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Click a button then user is asked what qty to filter or hide rows based on user input

    A partial solution would be helpful.

    j

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Click a button then user is asked what qty to filter or hide rows based on user input

    I haven't yet figured out how to enter an array, but I'm working on it
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Click a button then user is asked what qty to filter or hide rows based on user input

    Thanks for anything you can do.

  5. #5
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Click a button then user is asked what qty to filter or hide rows based on user input

    If we can figure this out using a recorded macro that is fine with me.
    Last edited by JET2011; 07-07-2017 at 11:15 AM. Reason: typo

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Click a button then user is asked what qty to filter or hide rows based on user input

    You'll probably want to play with this button:

    Please Login or Register  to view this content.
    And, I had something grander in mind but this seems to work!

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Click a button then user is asked what qty to filter or hide rows based on user input

    That looks interesting.. I'll need a little detail on how to exactly implement it. Thanks for your effort, looks like it took some work.

    -J

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Click a button then user is asked what qty to filter or hide rows based on user input

    Just run the recorded macro to place the button (I wasn't very fussy)

    The HQH routine goes in a standard module:

    Directions for running the routine(s) just supplied

    If you haven't used macros before you'll need to go to:
    File- options - trust center -trust center settings - macro settings ,
    the second option down (disable all macros with notification)

    Then - Copy the code to the clipboard

    Open your Workbook

    Press ALT + F11 to open the Visual Basic Editor.

    Select "Module" from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name (just push the button)


    *Save the book as macro-enabled
    Last edited by xladept; 07-07-2017 at 12:48 PM.

  9. #9
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Click a button then user is asked what qty to filter or hide rows based on user input

    I actually have it working - not sure how I even did it. Very happy to see it working. Little problem - I did not state my issue so clear, what I really need is it to hide the quantity entered by the user and also all the values below that number too. IE User enters 10, all quantities 10 and below are hidden. Another issue - how do I undo it? I tired entering o and it collapsed all my header rows. That was scary - I figured out how to run it (because the button was now hidden too) and entered 1 but I really don't want any hidden for the moment.
    Thanks again this will be very cool in the end for sure.
    -j

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Click a button then user is asked what qty to filter or hide rows based on user input

    Did you only want to be able to enter one number? The way it is now, there's no limit.

    You reset it by entering a null - just hit the enter key.

    *Each entry separated by a comma
    Last edited by xladept; 07-07-2017 at 05:36 PM.

  11. #11
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Click a button then user is asked what qty to filter or hide rows based on user input

    One number would be ideal. I did try 1,10 and it hid 1 and 10. I tried 1-10 and hid the same 2. The best would be enter 10 and 10 and below get hidden. A range be second best, say enter 1-10 which would hide 1-10.

    The null entry worked nicely and I liked how you added the little comment to tell the user what rows are hidden.

    Thanks for everything.

    Regards,

    -j
    Last edited by JET2011; 07-10-2017 at 10:42 AM.

  12. #12
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Click a button then user is asked what qty to filter or hide rows based on user input

    This is your preference:

    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Click a button then user is asked what qty to filter or hide rows based on user input

    Works - sweet! I have a need to move my data to column F, first data at F6 last at F448. Maybe I'll try to figure it out, wont be easy for me.

    Thanks again the is excellent!

    J

  14. #14
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Click a button then user is asked what qty to filter or hide rows based on user input

    Just change:

    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

    And - thanks for the rep!
    Last edited by xladept; 07-10-2017 at 05:37 PM.

  15. #15
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Boston
    MS-Off Ver
    MS 365
    Posts
    225

    Re: Click a button then user is asked what qty to filter or hide rows based on user input

    Its really great and thanks for your continued attention. Is this Cells (r, 6) change in just one place or the 3 times it appears? Also I don't want any hidden rows 1-5 so change the For r = 2 to r = 6. Seems to work fine as is.

    HTML Code: 

  16. #16
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Click a button then user is asked what qty to filter or hide rows based on user input

    Everywhere it appears. By all means, if your data starts in row 6 the the loop should start at row 6 - or whatever

+ 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. Hide All Rows and Display only one row based on User input
    By neetag in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-23-2020, 08:44 PM
  2. Auto filter based on user input with multiple choices
    By D.Lovell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2014, 04:23 PM
  3. [SOLVED]Hide Rows and Columns Based on User Input
    By thesteve in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-31-2013, 01:32 PM
  4. user defined macro to replace certain characters in a string based on user input
    By whatappears in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2012, 06:25 PM
  5. Insert user's name into cell based on windows user login when a button is clicked.
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 08-16-2011, 01:08 PM
  6. Apply Auto Filter Based on Date Input by User
    By ELDAN in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-10-2010, 09:07 PM
  7. Filter Data based on User Input
    By izet99 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-17-2009, 05:51 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