Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default ShowAll Data

Does anyone know how to check whether a filter is active
on a worksheet?

I want to ensure that all data is on show before running a
recorded macro. However if I try to "show all data" on a
worksheet where there is no criteria set on a filter I get
an error message.

Any ideas on how to avoid this?

Thanks,

CiaraG
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ShowAll Data

If activesheet.filtermode then
activesheet.showalldata
End if

--
Regards,
Tom Ogilvy

"CiaraG" wrote in message
...
Does anyone know how to check whether a filter is active
on a worksheet?

I want to ensure that all data is on show before running a
recorded macro. However if I try to "show all data" on a
worksheet where there is no criteria set on a filter I get
an error message.

Any ideas on how to avoid this?

Thanks,

CiaraG



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default ShowAll Data

Ciara,

Try this:

Sub ShowAllData()

Dim ws As Worksheet
Set ws = ActiveSheet

If ws.AutoFilterMode = True Then
For Each afFilter In ws.AutoFilter.Filters
If afFilter.On = True Then
ws.AutoFilter.Parent.ShowAllData
Exit For
End If
Next
End If

End Sub

--
Charles
www.officezealot.com


"CiaraG" wrote in message
...
Does anyone know how to check whether a filter is active
on a worksheet?

I want to ensure that all data is on show before running a
recorded macro. However if I try to "show all data" on a
worksheet where there is no criteria set on a filter I get
an error message.

Any ideas on how to avoid this?

Thanks,

CiaraG



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default ShowAll Data

this should work:

If ActiveSheet.AutoFilterMode And ActiveSheet.FilterMode Then
ActiveSheet.ShowAllData

chrs, john

"CiaraG" wrote in message
...
Does anyone know how to check whether a filter is active
on a worksheet?

I want to ensure that all data is on show before running a
recorded macro. However if I try to "show all data" on a
worksheet where there is no criteria set on a filter I get
an error message.

Any ideas on how to avoid this?

Thanks,

CiaraG



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
Increase Your Business By Data Conversion, Data Format and Data EntryServices in India Data Entry India Excel Worksheet Functions 1 March 31st 08 12:51 PM
Save 20% On Data Conversion and Data Formats Services by Data EntryIndia Data Entry India Excel Discussion (Misc queries) 0 March 31st 08 12:00 PM
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing [email protected] Excel Discussion (Misc queries) 0 March 20th 08 12:45 PM
showall not working Steve Excel Discussion (Misc queries) 3 February 13th 08 06:04 PM
MULTIPLE DATA - How to insert new data into existing data.... Rodorodo Excel Discussion (Misc queries) 0 December 15th 06 11:50 PM


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