+ Reply to Thread
Results 1 to 15 of 15

auto hide and unhide rows based on formula result in a cell

  1. #1
    Forum Contributor
    Join Date
    05-29-2012
    Location
    Walnut, Ca
    MS-Off Ver
    Excel 2010
    Posts
    180

    auto hide and unhide rows based on formula result in a cell

    I have a spreadsheet that has a formula in K4 and so on that has a true or false statement.

    If k4 is true, I want the row to hide and if it is false I want it to automatically unhide. The range is K4:K500

    The formula results are based on data input on another spreadsheet. Can someone please write a code that will allow for this to happen automatically?

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    6,404

    Re: auto hide and unhide rows based on formula result in a cell

    .
    Paste into the Sheet Module :

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-29-2012
    Location
    Walnut, Ca
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: auto hide and unhide rows based on formula result in a cell

    Thank you, I am very much an excel vba code virgin. How do I have it run, it doesn't list it in the macros list?

  4. #4
    Forum Contributor
    Join Date
    05-29-2012
    Location
    Walnut, Ca
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: auto hide and unhide rows based on formula result in a cell

    No rows were hidden when I saved the code.

    The sheet I am working with is the farm accounts.
    Attached Files Attached Files

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    6,404

    Re: auto hide and unhide rows based on formula result in a cell

    .
    Try now:
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    06-12-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    167

    Re: auto hide and unhide rows based on formula result in a cell

    Quote Originally Posted by Logit View Post
    .
    Paste into the Sheet Module :

    Please Login or Register  to view this content.
    I am just trying to understand what exactly does the application.screenUpdating=false do?

  7. #7
    Forum Contributor
    Join Date
    05-29-2012
    Location
    Walnut, Ca
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: auto hide and unhide rows based on formula result in a cell

    Thank you but it's not auto unhiding? Also, how did you get it to run. I am a newbie at this.

  8. #8
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    6,404

    Re: auto hide and unhide rows based on formula result in a cell

    .
    Your original post said a "formula" approach vs macro. Although you did not explicitly indicate such, it lead me to believe you were using another formula or macro to paste the terms "True" or "False" into the specific cells.
    Is this the case ?

    If not, we will need to change the code and perhaps make it run via a Command Button.


    Re: what does Application.Screenupdating do ? If FALSE it prevents any changes in the display (what you see on the screen) until the code gets to Screenupdating = True. Then, any changes that were created
    from the macro code are seen at one time. Basically, it prevents screen flutter so any transition changes appear smooth - without flickering.

  9. #9
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    6,404

    Re: auto hide and unhide rows based on formula result in a cell

    .
    When the word TRUE or FALSE is placed in the appropriate cell, the row hides or unhides.

  10. #10
    Forum Contributor
    Join Date
    05-29-2012
    Location
    Walnut, Ca
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: auto hide and unhide rows based on formula result in a cell

    The cell where it says true or False is generated by a formula. The spreadsheet was only a few sheets of my entire spreadsheet so when I tried copying and pasting your code in my actual spreadsheet, nothing happened.

  11. #11
    Forum Contributor
    Join Date
    05-29-2012
    Location
    Walnut, Ca
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: auto hide and unhide rows based on formula result in a cell

    Of course as soon as I hit post reply, it starts working. Thank you for all of your help.

  12. #12
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    6,404

    Re: auto hide and unhide rows based on formula result in a cell

    Did you paste the macro in the Sheet Level Module for Farm Accounts in the VB Editor ?

    Farm.jpg

  13. #13
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    6,404

    Re: auto hide and unhide rows based on formula result in a cell

    .
    No problem.

    I've had the same experiences. It's almost like Excel wants to embarrass me before it goes to working.

    You are welcome.

  14. #14
    Registered User
    Join Date
    12-12-2017
    Location
    wilmington, oh
    MS-Off Ver
    2016
    Posts
    14

    Re: auto hide and unhide rows based on formula result in a cell

    good info!
    Last edited by jroyse; 12-14-2017 at 08:37 AM.

  15. #15
    Registered User
    Join Date
    12-12-2017
    Location
    wilmington, oh
    MS-Off Ver
    2016
    Posts
    14

    Re: auto hide and unhide rows based on formula result in a cell

    good info!
    Last edited by jroyse; 12-14-2017 at 08:39 AM.

+ 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] Macro to Hide/Unhide rows based on the result of a formula
    By c850b in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-20-2015, 12:52 PM
  2. [SOLVED] Hide/Unhide sheets based on text result of IF Formula in cell in another sheet
    By yukinosei in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-16-2014, 01:17 PM
  3. hide and unhide rows based on formula result
    By tjanda in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-28-2012, 04:20 AM
  4. [SOLVED] Hide/Unhide Rows Based On Cell Result
    By stockjc in forum Excel General
    Replies: 5
    Last Post: 08-29-2012, 09:37 PM
  5. Replies: 1
    Last Post: 08-21-2012, 02:46 PM
  6. Hide/Unhide rows based on cell value (result of formula)
    By tjanda in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-17-2012, 05:57 PM
  7. Auto Hide/Unhide rows in Excel based on formula result in a column
    By crozierk in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 08-12-2012, 08: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