Google Answers Logo
View Question
 
Q: Excel visual basic autofilter and visible rows ( Answered,   0 Comments )
Question  
Subject: Excel visual basic autofilter and visible rows
Category: Computers > Programming
Asked by: les9999-ga
List Price: $10.00
Posted: 09 Sep 2004 11:16 PDT
Expires: 09 Oct 2004 11:16 PDT
Question ID: 398942
I have a spreadsheet that has autofilters turned on and some filters
in use. I would like to process only those rows that are still
visible. In VB how can I tell that a row is visible?
Answer  
Subject: Re: Excel visual basic autofilter and visible rows
Answered By: palitoy-ga on 09 Sep 2004 11:31 PDT
 
Hello Les9999

To check whether a row is visible or not in VB you can use something like this:

=================================================================
If Not (Cell.EntireRow.Hidden ) Then 
...
End If
=================================================================

where Cell is a Range.

If you wish to check a column you can use "EntireColumn".

I hope this answers your query, if you need any further help please
ask for clarification and I will do my best to help.

Clarification of Answer by palitoy-ga on 09 Sep 2004 12:14 PDT
As a further example:

Function MyRowCount(MyRange As Range) As Integer 
    Dim c As Range 
    For Each c In MyRange 
        If (c.Value = 1) And (c.EntireRow.Hidden = False) Then 
            MyRowCount = MyRowCount + 1 
        End If 
    Next c   
End Function

You could then use =MyRowCount(E5:E10) in a cell to count all the
visible rows within the range E5 to E10.

Request for Answer Clarification by les9999-ga on 09 Sep 2004 12:27 PDT
Thanks, that did it!!

Clarification of Answer by palitoy-ga on 10 Sep 2004 01:07 PDT
Great! I'm glad I could help.
Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy