+ Reply to Thread
Results 1 to 15 of 15

creating a button to hide and unhide rows one by one in excel 2007

  1. #1
    Registered User
    Join Date
    10-10-2014
    Location
    seattle wa
    MS-Off Ver
    2007
    Posts
    63

    creating a button to hide and unhide rows one by one in excel 2007

    I would like to create a button (something like spin button) that can hide and un-hide row. I have rows from 1 to 200 with Age and i want the user to be able to see any row in between. by going up or down, they should be able to pick up any rows they want to look at. Is this possible without doing a VBA code. I yes, how?

    Thank you

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

    Re: creating a button to hide and unhide rows one by one in excel 2007

    You could just Freeze Panes after your header rows
    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

  3. #3
    Registered User
    Join Date
    10-10-2014
    Location
    seattle wa
    MS-Off Ver
    2007
    Posts
    63

    Re: creating a button to hide and unhide rows one by one in excel 2007

    I have a graph reading the data, when i just do Freeze panes it does not change the graph. when i go and hide the row, my graph changes and show we ages for only the data that is unhidden. So i prefer to have a button that will do the hide and unhide, instead of right clicking on the row and hiding the row.

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

    Re: creating a button to hide and unhide rows one by one in excel 2007

    I think that it requires VBA

  5. #5
    Registered User
    Join Date
    10-10-2014
    Location
    seattle wa
    MS-Off Ver
    2007
    Posts
    63

    Re: creating a button to hide and unhide rows one by one in excel 2007

    Would you be able to tell me how I can input VBA code and what is the code?

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: creating a button to hide and unhide rows one by one in excel 2007

    "Is it possible?" Yes, but its not clear to me which row you want un/hidden based on the spin button being pressed.

    You have rows 1-200. If they are all visible, which rows do you want hidden if the down is pressed? etc.

    Also, have you looked at AutoFilter?
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  7. #7
    Registered User
    Join Date
    10-10-2014
    Location
    seattle wa
    MS-Off Ver
    2007
    Posts
    63

    Re: creating a button to hide and unhide rows one by one in excel 2007

    I would like my users to just see the form that i created not to touch the data, That is why I don't want to use Auto Filter. Also, I have data in row starting at 65 to 265. I would like the spin button to go threw each row to hide and unhide. There are graphs linked to this data as well. Users will see the graphs change when they hide or unhide the rows. For example, if the users want to see the data in row 70 threw 100. They should be able to hide rows before 70 and after

  8. #8
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: creating a button to hide and unhide rows one by one in excel 2007

    "if the users want to see the data in row 70 threw 100. They should be able to hide rows before 70 and after"

    How does the Excel know that the user wants 70:100?

    Does the spin button change the 75 or the 100 or is there some other mechanism for the user choosing the rows to see?

  9. #9
    Registered User
    Join Date
    10-10-2014
    Location
    seattle wa
    MS-Off Ver
    2007
    Posts
    63

    Re: creating a button to hide and unhide rows one by one in excel 2007

    age data.xlsx.pngEach row has a age in years as data, if they only want to look at failures that occur before they turned 70 years old they would need to hide the other rows. I have attached the screen shot of what I am talking about. I don't want user to touch the data under the graphs, There is form created on top of the graph, where i would like to place the spin button. Is it possible or no?

  10. #10
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: creating a button to hide and unhide rows one by one in excel 2007

    Its possible, maybe.

    Two spin buttons would be the way that I went.
    One would change the first invisible row.
    the other would change the last visible row.

    I'll revisit this thread after I get off work.

  11. #11
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: creating a button to hide and unhide rows one by one in excel 2007

    This code will work with two spin buttons from the Forms menu.
    Assign the macro TopChange to both of them.
    Adjust HideableRange to the range to match your situation
    Run SetUp to set the initial variables.


    This is a bit clunky, since the Form menu buttons don't fire until the mouse button is raised.
    My Mac doesn't use ActiveX controls, but two ActiveX spin buttons and their Change event would be a smoother user interface.

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: creating a button to hide and unhide rows one by one in excel 2007

    If i see it correctly the users reference to what he want to see would be the horizontal Axis with 0-99.
    So if i am the user i should be able to type 5 - 20 and it would hide all rows that have ageyears smaller 5 and bigger 20 so that they dissappear in the Graph
    Is that correct so far?

  13. #13
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: creating a button to hide and unhide rows one by one in excel 2007

    coputer posted 2 times :D
    Last edited by LordLoki; 07-02-2015 at 09:49 AM. Reason: please delete

  14. #14
    Registered User
    Join Date
    10-10-2014
    Location
    seattle wa
    MS-Off Ver
    2007
    Posts
    63

    Re: creating a button to hide and unhide rows one by one in excel 2007

    Lord Loki , yes you are correct
    Mike I am working on putting the code in, thank you

  15. #15
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: creating a button to hide and unhide rows one by one in excel 2007

    hi Gill,

    I made an Example where i use a userform with 2 comboboxes to set the Range.
    You could modify the code to use worksheet change so the user can type the values in a cell next to the Chart
    hope that helps you

    Greets
    Loki
    Attached Files Attached Files

+ 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. Down and up button to unhide or hide rows
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2013, 08:55 PM
  2. Auto Hide/Unhide rows in Excel based on radio button selection
    By awill110 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-30-2013, 03:05 PM
  3. Excel 2007 advanced macros assigned to button to Hide/Unhide Rows
    By newbie77 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-08-2011, 01:05 PM
  4. Excel 2007 : Hide and unhide rows using a button
    By littlefoot in forum Excel General
    Replies: 2
    Last Post: 11-28-2011, 06:10 AM
  5. Button to hide and unhide rows
    By twofootgiant in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-13-2008, 04:37 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