+ Reply to Thread
Results 1 to 4 of 4

Button to show/Hide rows not working

  1. #1
    Registered User
    Join Date
    05-04-2015
    Location
    South Africa
    MS-Off Ver
    office for Mac
    Posts
    97

    Question Button to show/Hide rows not working

    Can Anyone please help me? I am struggling with the code for a button to show/hie specific rows:

    Please Login or Register  to view this content.
    Let us assume Cell "I2" can be two different variables. The two variables is "Large enterprise" and "Qualifying Small Enterprise". When cell I2 is "large", then the code should hide rows 160:178, hide rows 5:151 but show 180:194. Therefore, when it is clicked again, it only shows rows 5:151, but hides rows 160:194. When cell I2 is "Qualifying Small Enterprise" then it needs to swap around when the button is clicked i.e. 180:194 is shown, and 160:178 is hidden, with the other features staying the same. The "Qualifying Small Enterprise" part does not want to work. It does not show row 5:151 when the button is clicked again after it has shows row 180:194. I have attached the sheet for your attention. can anyone please help, as I do not know what I am doing wrong.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,088

    Re: Button to show/Hide rows not working

    I would suggest to use (NOT TESTED, some issue to doawload the file)
    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    05-04-2015
    Location
    South Africa
    MS-Off Ver
    office for Mac
    Posts
    97

    Re: Button to show/Hide rows not working

    Thank you for the suggestion, however rows 180:194 does not want to hide if I click the button again. I have attached the file again for your information. I don't know what I am doing wrong. Need to inform you that I am very new to VBA. Thank you sooo much for the assistance already. My code look as follows:

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

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,088

    Re: Button to show/Hide rows not working

    I would suggest to go step by step.
    Select all rows and unhide
    Go to the macro and put a breakpoint: select the first statement and press F9 in the left margin
    Launch the macro and use F8 and see what's happen

+ 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] Show/Hide tabs on one button
    By lukestkd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-22-2013, 02:14 PM
  2. VBA hide row based on pull down with button to toggle show/hide
    By myronr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-12-2012, 06:07 PM
  3. Show/Hide Button
    By sdbrown81 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-17-2012, 09:19 AM
  4. Hide/Show Button
    By Kolin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-14-2010, 07:00 PM
  5. command button on/off (show/hide)
    By gobbolino in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2007, 10:35 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