LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Tony W
 
Posts: n/a
Default Find the number of rows returned in a filter

I would like to filter a list and test for no match. For example

Sub FilterTest(market as string)

Excel.Application.Screenupdating = false
Excel.sheets("SS").visible = true
Excel.sheets("SS").select
Excel.sheets("SS").range("B10").select
Excel.Selection.AutoFilter
Excel.Selection.AutoFilter Field:=1, Criteria1:="<1*", Operator:=xlAnd, _
Criteria2:="<*T"
Excel.Application.screenupdating = true
'now here is what I want to test
If (the filter retuns no visible records or rows) then
Msgbox "The "& market & " market does not meet this criteria.",vbOKOnly
end if

End sub

I am not sure of the proper syntax to count the number of visible
records(rows) in an Excel filter. Basically if the count is 0 then display
the message box.

Thanks for your help in advance!
Note: I use Excel. for each line because people open my excel files in
Internet Explorer (they use Xerox DocuShare or SharePoint). If you know a
better way to handle ScreenUpdating,DisplayAlerts and commandbars that would
be great. Initially I would receive an error from IE when trying to turn
on/off screenupdating and display alers.

 
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
Find duplicate rows then deleting them SSHO_99 Excel Worksheet Functions 4 May 4th 07 11:17 AM
how can i filter from two rows? Ali Excel Discussion (Misc queries) 1 December 20th 04 08:19 PM
increasing the number of rows of a worksheet beyond 65536? ibu Excel Discussion (Misc queries) 2 November 26th 04 08:56 AM
Can I set a filter for a merged column across multiple rows and o. Martin Excel Worksheet Functions 2 November 25th 04 01:01 PM
Data Filter - Not all rows in spreadsheet will display in Autofilt Excel Help Excel Worksheet Functions 1 November 17th 04 05:40 PM


All times are GMT +1. The time now is 11:30 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"