Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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
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
Macro for pop up message box for auto-filter entry Roady Excel Discussion (Misc queries) 1 January 20th 09 06:26 PM
Enable macro message on VBA Workbook Open then macro ends Barb Reinhardt Excel Programming 2 July 15th 08 03:59 PM
Advanced Filter - error message Mifty New Users to Excel 2 May 25th 06 07:02 PM
Need macro to filter, create tab on filter and copy/paste Jen[_11_] Excel Programming 1 May 2nd 06 04:45 PM
Need macro to filter, create tab on filter and copy/paste Jen[_11_] Excel Programming 1 May 2nd 06 04:45 PM


All times are GMT +1. The time now is 03:46 AM.

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

About Us

"It's about Microsoft Excel"