+ Reply to Thread
Results 1 to 10 of 10

First unhide all rows - then hide rows based on specific cell value for a range of cells

  1. #1
    Registered User
    Join Date
    10-16-2013
    Location
    Portland, OR
    MS-Off Ver
    Excel 2007
    Posts
    9

    First unhide all rows - then hide rows based on specific cell value for a range of cells

    Hi All,

    This is my first post so I hope I explain myself accurately. Any help I can get on this would be GREATLY appreciated, as I have researched this topic for about two hours and am still unable to find a good solution to my specific situation. Here's what I'm looking for:

    First, I want this macro to run only on the "RD Summary" sheet, not the entire workbook. Then, I want to unhide all rows on the worksheet. Then, I want to hide any rows in column B within the range of b25 to B400, if the cell value in column B is "n/a". Also, I'm not sure if this matters, but the cell values are all formulas.

    Please let me know if you have any suggestions for this. I REALLY appreciate your help - this could save me so much time!!!

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: First unhide all rows - then hide rows based on specific cell value for a range of cel

    Hello robbiekh,

    Welcome to the Forum.

    I presume that it was your intention to upload a sample Workbook, since we don't seem to have a "RD Summary" sheet anywhere.

    Regards
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Registered User
    Join Date
    10-16-2013
    Location
    Portland, OR
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: First unhide all rows - then hide rows based on specific cell value for a range of cel

    Hi Winon,

    Thanks for your quick response. I can't upload the specific workbook I'm going to use this on because it has personal/private information on it. However, I attached a sheet here that's a very watered down version of what I'll be using this for. Does this help?? BD Summary Report.xlsx

    Thanks again,
    Robbie

  4. #4
    Registered User
    Join Date
    10-16-2013
    Location
    Portland, OR
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: First unhide all rows - then hide rows based on specific cell value for a range of cel

    Hi Winon,

    Just replying to see if you saw my attachment and if it's helpful, or what other information would help solve this issue. Thanks!

    Robbie

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: First unhide all rows - then hide rows based on specific cell value for a range of cel

    Hello robbiekh,

    Sorry for the late reply, but we have been experiencing some Internet connection problems.

    Please see if the attached sample Workbook does what you want.

    Regards
    Attached Files Attached Files

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: First unhide all rows - then hide rows based on specific cell value for a range of cel

    Hi, Winon,

    First, I want this macro to run only on the "RD Summary" sheet
    Your code runs on the active sheet.

    Please Login or Register  to view this content.
    Nice workout with the buttons (IŽd preferred a toggle button instead or an ActiveX command button - like stated: my (bad) taste ).

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  7. #7
    Registered User
    Join Date
    10-16-2013
    Location
    Portland, OR
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: First unhide all rows - then hide rows based on specific cell value for a range of cel

    Hi Winon,

    Yes, this does exactly what I want it to do!! I also like how you set up the button, but the only problem is that I can't figure out how to get it to work on my other spreadsheet. I think it has something to do with how the code is programmed with the button.... it has a problem at this part

    .Shapes("Button 1").Visible = msoFalse
    .Shapes("Button 2").Visible = msoTrue"

    Any suggestions on how to set up my own version of your button on my other spreadsheet, or another way to get the code to work, would be greatly appreciated!

    Thanks,
    Robbie

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: First unhide all rows - then hide rows based on specific cell value for a range of cel

    Hi robbiekh,

    When you copy Buttons to another Sheet or another Workbook, Excel may rename it with another value.

    So just right click on the newly copied Button, and its full reference "name" will be displayed in the Name Box to the left of the Formula Bar. Then change the code accordingly.

    Regards

  9. #9
    Registered User
    Join Date
    10-16-2013
    Location
    Portland, OR
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: First unhide all rows - then hide rows based on specific cell value for a range of cel

    Winon,

    Thank you! That worked!

    Thanks for all your help!

    Robbie
    Last edited by robbiekh; 10-22-2013 at 04:45 PM.

  10. #10
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: First unhide all rows - then hide rows based on specific cell value for a range of cel

    Hello robbiekh,

    You are welcome.

    Glad to see that you could sort it out.

    Regards

+ 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. Auto Hide And Unhide Row Based On Empty Cell In Specific Range
    By jackgan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-26-2013, 09:18 AM
  2. [SOLVED] VBA for hide/unhide specific rows automatic if certain cell value is more then pre define
    By santosh226001 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-05-2013, 08:58 AM
  3. Hide/Unhide Rows & Colums based on Separate range
    By TohirT in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2013, 10:07 AM
  4. Replies: 2
    Last Post: 01-09-2012, 07:13 AM
  5. Hide/Unhide rows based on 3 cells values
    By bimmer5dude in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-24-2008, 11:02 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