Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro - message when there is nothing to filter
Hi,
Please help. For a certian column, I currently I have a macro that filters when cells = "WWW". How do I include in this macro a message for the user when there is nothing to filter. Thank you. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro - message when there is nothing to filter
I'm not sure what you're looking for, but the following may point you
in the right direction. If your data is in A1:A100 where A1 is the heading, use code like Sub AAAA() Dim R As Range Set R = Range("A2:A100") With Application.WorksheetFunction If .CountA(R) = 0 Then Debug.Print "no data to filter" Else If .Subtotal(103, R) = .CountA(R) Then Debug.Print "no items filtered" Else Debug.Print "some items filtered" End If End If End With End Sub This tests whether the data list is empty (no data to filter), or some values have been filtered out, or no items have been filtered out. Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Tue, 4 Nov 2008 15:24:03 -0800 (PST), misskh wrote: Hi, Please help. For a certian column, I currently I have a macro that filters when cells = "WWW". How do I include in this macro a message for the user when there is nothing to filter. Thank you. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro for pop up message box for auto-filter entry | Excel Discussion (Misc queries) | |||
Enable macro message on VBA Workbook Open then macro ends | Excel Programming | |||
Advanced Filter - error message | New Users to Excel | |||
Need macro to filter, create tab on filter and copy/paste | Excel Programming | |||
Need macro to filter, create tab on filter and copy/paste | Excel Programming |