+ Reply to Thread
Results 1 to 10 of 10

Possible to have a cell detect if there are hidden rows and yield a YES/NO result?

  1. #1
    Registered User
    Join Date
    01-16-2009
    Location
    Texas
    MS-Off Ver
    2013, 2015, 2016
    Posts
    43

    Question Possible to have a cell detect if there are hidden rows and yield a YES/NO result?

    I am designing a worksheet and it will be used by people other than myself. While I will remember if I have hidden rows or not, someone else may not remember to check.

    Is there a way to make a cell that can check the sheet for hidden rows, and if so yield just a Yes/No result.

    I want to just make a cell that says "Hidden Rows?" and the one next to it say "YES" or "NO".

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Possible to have a cell detect if there are hidden rows and yield a YES/NO result?

    You could use a UDF.

    Please Login or Register  to view this content.
    To add to workbook hit Alt+F11, Insert->Module and paste it there. Close that window.

    Then in let's say A2 put =HiddenCheck(A:A)
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Possible to have a cell detect if there are hidden rows and yield a YES/NO result?

    @daffodil11: if there are NO hidden rows, won't it be a bit slow if you check an entire column?


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Possible to have a cell detect if there are hidden rows and yield a YES/NO result?

    Yes, it's terrible, especially considering I made the function volatile. A solid 2-3 seconds.

    VB is your more realm than mine. My brain just couldn't come up with something that didn't literally check everything.

    Perhaps if we knew that a single Column might always have data in it that's being hidden, we could check the difference of counts? The instrinsic functions always seem to process a great deal more efficiently, such as COUNTBLANK(A:A)

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Possible to have a cell detect if there are hidden rows and yield a YES/NO result?

    If there are no empty cells within the data range you could use a SUBTOTAL = COUNTA formula. TRUE = no hidden rows. FALSE = hidden rows.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Possible to have a cell detect if there are hidden rows and yield a YES/NO result?

    There we go. I'm getting too old for this.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Possible to have a cell detect if there are hidden rows and yield a YES/NO result?

    Quote Originally Posted by Tony Valko View Post
    If there are no empty cells within the data range you could use a SUBTOTAL = COUNTA formula. TRUE = no hidden rows. FALSE = hidden rows.
    After some quick testing it seems that empty cells would not affect the result.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Possible to have a cell detect if there are hidden rows and yield a YES/NO result?

    Clarification...

    If the hidden rows (if any) will only be within the data range try something like this:

    A1 = Hidden Rows?

    This formula in B1:

    =IF(SUBTOTAL(103,A:A)=COUNTA(A:A),"No","Yes")

  9. #9
    Registered User
    Join Date
    01-16-2009
    Location
    Texas
    MS-Off Ver
    2013, 2015, 2016
    Posts
    43

    Re: Possible to have a cell detect if there are hidden rows and yield a YES/NO result?

    Sorry for the slow reply back folks.

    First of thank you for all the help. Good to see so much feedback.

    The rows that are being hidden have some zero values but not all (example, Column A and Column B could have separate zero values causing me to need to hide the row.) However I could probably use an OR statement in there to get it to work. However I will probably use the Module you made instead. It may take a few seconds, but that is fine.

    Thank you folks!

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Possible to have a cell detect if there are hidden rows and yield a YES/NO result?

    Good deal. Thanks for the feedback!

+ 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. VBA: calculate yield every 2 rows of 1 column in excel
    By zeno1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-22-2012, 12:13 PM
  2. Bond Yield to Maturity using the Yield function in Excel
    By rahulk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-13-2009, 03:32 PM
  3. Replies: 3
    Last Post: 08-08-2006, 08:10 AM
  4. How to detect if a workbook is hidden through VBA
    By Aaron in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-13-2005, 03:05 PM
  5. How to detect if sheet is hidden?
    By hstijnen in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-24-2005, 11:06 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