Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Macro / Autofilter / Show All Data

Hi,

I wrote in the macro
ActiveSheet.ShowAllData
but if no filtering is set, I get error message.
Is it possible to say something like
If 'filtered...'

Thanks and regards,

Cousin Excel
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default Macro / Autofilter / Show All Data

The easiest way will be by adding:
On Error resume Next
as the first command of the macro.
Micky


"CousinExcel" wrote:

Hi,

I wrote in the macro
ActiveSheet.ShowAllData
but if no filtering is set, I get error message.
Is it possible to say something like
If 'filtered...'

Thanks and regards,

Cousin Excel

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default Macro / Autofilter / Show All Data

As On error may cause some other "problems" - try this:
If ActiveSheet.FilterMode Then ActiveSheet.ShowAllData
Micky


"מיכאל (מיקי) אבידן" wrote:

The easiest way will be by adding:
On Error resume Next
as the first command of the macro.
Micky


"CousinExcel" wrote:

Hi,

I wrote in the macro
ActiveSheet.ShowAllData
but if no filtering is set, I get error message.
Is it possible to say something like
If 'filtered...'

Thanks and regards,

Cousin Excel

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro / Autofilter / Show All Data

If you want to remove the filter (and filter arrows):

With worksheets("Somesheetnamehere")
.autofiltermode = false
end with

If you want to just show the data, but keep the arrows:

With worksheets("Somesheetnamehere")
if .filtermode then
'some filter is applied
.showalldata
end if
end with

CousinExcel wrote:

Hi,

I wrote in the macro
ActiveSheet.ShowAllData
but if no filtering is set, I get error message.
Is it possible to say something like
If 'filtered...'

Thanks and regards,

Cousin Excel


--

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
Macro - filter - show all data Eva Excel Worksheet Functions 2 February 15th 10 10:07 PM
autofilter show all data RN Mark Excel Discussion (Misc queries) 5 May 10th 09 12:24 PM
How can i Change Autofilter data from top till bottom in macro Vijay Kotian Excel Discussion (Misc queries) 0 September 5th 06 09:10 AM
Autofilter- show dates differently lunker55 Excel Discussion (Misc queries) 3 November 10th 05 06:58 PM
Why does AutoFilter not show all the data in the pull down? sacwia01 Excel Discussion (Misc queries) 3 October 4th 05 07:41 PM


All times are GMT +1. The time now is 07:37 PM.

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"