+ Reply to Thread
Results 1 to 9 of 9

Table Object after filtering - Count visible rows & First visible row

  1. #1
    Registered User
    Join Date
    09-13-2013
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    17

    Table Object after filtering - Count visible rows & First visible row

    Hi,

    I have been working with tables and sometimes I do not get the right value for rows counts and first visible row (excluding headings).

    I have a table object - TabResults filtered usind field 2 with criteria "Active".

    Could you please share a very reliable way to:

    Process 1 - Count visible cells (without heading) that gives 0 when no results are found after filtering.

    Process 2 - Get the row number of the first visible row (excluding headings), and showing a msgbox "No visible row" when no visible are available.

    This is pretty much the basis of my code to use a database. So it must be very solid.


    Thank you very much for your help!

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Table Object after filtering - Count visible rows & First visible row

    Have a look on SUBTOTAL and better send a file sample with a display of the results you want

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Table Object after filtering - Count visible rows & First visible row

    This might help.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    09-13-2013
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Table Object after filtering - Count visible rows & First visible row

    Thanks so much! It works very well!

  5. #5
    Registered User
    Join Date
    09-13-2013
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Table Object after filtering - Count visible rows & First visible row

    Hi again,

    I am sorry for coming back to this, but that code works fine when I have more than one visible row in the table body. With no visible cells on the table body, it give the same count as with one visible row, 1.

    I am using the code specially to find if is there any entry or not and use it in case it exists. Can you please have a look on the code?
    Thank you!

    Also the statement does not work then there are no visible rows in the table body.

    Please Login or Register  to view this content.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Table Object after filtering - Count visible rows & First visible row

    Why aren't you checking if the range is Nothing?

    Can you upload an example workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

  7. #7
    Registered User
    Join Date
    09-13-2013
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Table Object after filtering - Count visible rows & First visible row

    Thank you for your answer. Actually I was trying different combinations and I just pasted one different from your suggestion. Here is a sample - Can you please have a look on it? Thank you in advance!
    Attached Files Attached Files

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Table Object after filtering - Count visible rows & First visible row

    The problem was non-contigent areas in the filter result.

    Give this a try.
    Please Login or Register  to view this content.
    PS Don't add On Error Resume Next anywhere else, if you encounter any other errors/problems post back.

  9. #9
    Registered User
    Join Date
    09-13-2013
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Table Object after filtering - Count visible rows & First visible row

    Thank you Norie! So far so good... I know that this can be too much, but would you be able to explain why your previous solution did not work? It looked less complex than this alternative.

    Anyway, thank you so much!

+ 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. Use visible rows from autofilter to build Pivot table. Or use visible rows to Copy/Paste
    By mwhitedesigns in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2012, 10:34 AM
  2. Random Selection of Visible Rows after Filtering
    By Saarang84 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 10-12-2010, 09:45 PM
  3. How to total only visible columns or rows after filtering
    By slipit1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-01-2009, 05:20 PM
  4. Resize Visible Rows based only on Visible Columns text
    By Zimbo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-22-2009, 10:55 AM
  5. [SOLVED] count only the visible rows in a data table
    By Eric in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-21-2005, 09:05 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