+ Reply to Thread
Results 1 to 14 of 14

Hide or Show rows based off value of cell in that row?

  1. #1
    Registered User
    Join Date
    10-19-2011
    Location
    Boston, USA
    MS-Off Ver
    Excel 2007
    Posts
    42

    Question Hide or Show rows based off value of cell in that row?

    Hello,


    I have a worksheet named "Requirements" that I would like rows to be hidden dependent on whatever the value of cells L25:L1078 are.

    So, if L25 is "True" then Row 25 goes hidden. Likewise, if data changes and L25 changes to "False" I would like row 25 to reappear.

    I would like this to be true for rows 25 through 1078.

    Is there any way to do this without VBA being used? If not, can anyone provide baby steps for how to accomplish in VBA. I have very little experience with VBA.

    Any help would be greatly appreciated.

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

    Re: Hide or Show rows based off value of cell in that row?

    Hi dancor31

    Right click on sheet Tab, view code and paste this in: How does your workbook currently allow for a hidden row to be edited and changed to "FALSE"
    Please Login or Register  to view this content.
    Edited:Added sample workbook
    Attached Files Attached Files
    Last edited by sintek; 05-16-2017 at 04:11 PM.
    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!!!

  3. #3
    Registered User
    Join Date
    10-19-2011
    Location
    Boston, USA
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Hide or Show rows based off value of cell in that row?

    The value of the cell comes from a different sheet, so I won't ever be physically typing in the sheet named "Requirements". Your script works like a charm, however, is there a way to make the worksheet update when data changes rather than having to run the macro manually each time?
    Last edited by dancor31; 05-16-2017 at 03:51 PM.

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

    Re: Hide or Show rows based off value of cell in that row?

    The code depending on which sheet you have pasted it into automatically does what is required.

  5. #5
    Registered User
    Join Date
    10-19-2011
    Location
    Boston, USA
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Hide or Show rows based off value of cell in that row?

    On my sheet "Requirements", cells in column L either return a value of True or False. These values come from a sheet named "Power Menu" and are based off of whether the a particular cell has a value greater than 0.

    The "Power Menu" cells are populated based on data it receives from other sheets. I can enter data in other sheets, check to confirm that the "Power Menu" updated correctly, and then go to the "Required" sheet with no apparent changes to the view. If I manually click to run the macro you created, it then updates. Am I missing something in the setup that would make this a dynamic process where when data changes the macro runs on it's own, updating the correct rows?

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

    Re: Hide or Show rows based off value of cell in that row?

    Have a look at sample workbook attached in post 2...Perhaps upload your sample too.

  7. #7
    Registered User
    Join Date
    10-19-2011
    Location
    Boston, USA
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Hide or Show rows based off value of cell in that row?

    Here is a quick watered down sample that should show what I am trying to do with the requirements sheet.
    Attached Files Attached Files

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

    Re: Hide or Show rows based off value of cell in that row?

    see your workbook attached
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-19-2011
    Location
    Boston, USA
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Hide or Show rows based off value of cell in that row?

    Thanks... I am a bit dense when it comes to VBA and using it correctly. I have added the script from your sample to the same sheet in my workbook. My apologies, but how do I get it to work. Am I missing a step?

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

    Re: Hide or Show rows based off value of cell in that row?

    Take the workbook attached in post 8 and just type TRUE in place of FALSE....the row gets hidden , so when the other sheet sends true to this sheet the row becomes hidden...

  11. #11
    Registered User
    Join Date
    10-19-2011
    Location
    Boston, USA
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Hide or Show rows based off value of cell in that row?

    Here is the actual sheet that I am working on. You can see that your script works, but then seems to only partially update, then not update at all. Note the "true" rows still being displayed.
    Attached Files Attached Files

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

    Re: Hide or Show rows based off value of cell in that row?

    I cannot use attached...I suggest you go to the sheet that edits that allows your sheet to become TRUE..... Allow all values to be False.........
    THEN start again.....Put code in and now once the values become TRUE, the code will take effect.

  13. #13
    Registered User
    Join Date
    05-17-2017
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    20

    Re: Hide or Show rows based off value of cell in that row?

    Hey sorry to thread jack, but how will this work if i want to hide a cell that is blank?

    Instead of "True" what should one enter, THANKS!

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

    Re: Hide or Show rows based off value of cell in that row?

    dancor31...The code takes effect as soon as there is a cell change in your specified range....So allow for that and see what happens...

    @ HighExcel...Not cool lol

    Please Login or Register  to view this content.

+ 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. Show Hide Rows based on cell value
    By Juicy2052 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-13-2015, 07:55 AM
  2. [SOLVED] Macro to Show/Hide Rows Based on Text in Cell
    By HCopeland3 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-01-2014, 03:56 PM
  3. [SOLVED] Show/hide rows based on drop down cell using named ranges
    By Stu091074 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2014, 11:00 AM
  4. Hide Show rows based on cell value true or false using VBA
    By gopal904 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-12-2013, 07:31 AM
  5. Need help to show/hide rows based on values from a cell
    By concurmgr in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-19-2012, 02:56 PM
  6. [SOLVED] Hide/Show rows based on the value in a cell
    By PatRiot199 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-11-2012, 11:52 PM
  7. Show/Hide Specific set of Rows based on Criteria in one cell
    By mrgillus in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-11-2010, 01:26 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