Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Count displayed rows

I am trying to run this code in Excel 2k so that I can count the number of
displayed rows when I display only Subtotal totals. Unfortunately, I get a
run-time error 91
"Object variable or With block variable not set". With so little code, I can
believe this is not working? Desperately seeking wisdom :{

Dim rng as Range
set rng = ActiveSheet.Autofilter.Range.Columns(1).specialCel ls(xlVisible)
msgbox rng.Count - 1 & " data rows are visible"

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Count displayed rows

Same response as Tuesday:


You haven't applied data|filter|autofilter to your worksheet -- look for those
dropdown arrows and you'll see that they aren't there.



GDCross wrote:

I am trying to run this code in Excel 2k so that I can count the number of
displayed rows when I display only Subtotal totals. Unfortunately, I get a
run-time error 91
"Object variable or With block variable not set". With so little code, I can
believe this is not working? Desperately seeking wisdom :{

Dim rng as Range
set rng = ActiveSheet.Autofilter.Range.Columns(1).specialCel ls(xlVisible)
msgbox rng.Count - 1 & " data rows are visible"


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rows not being displayed Barb Reinhardt Excel Discussion (Misc queries) 1 May 5th 09 09:55 PM
Number of rows displayed in worksheet cjstober Excel Discussion (Misc queries) 1 January 31st 05 11:59 PM
Whats the function to count the total times a word is displayed Monk Excel Discussion (Misc queries) 3 December 10th 04 10:39 PM
How To Count Rows Displayed After Applying AutoFilter Steve[_32_] Excel Programming 2 August 12th 03 02:45 PM
Displayed Collumns and Rows John Tripp[_2_] Excel Programming 2 July 31st 03 09:33 PM


All times are GMT +1. The time now is 06:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"