Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Eva Eva is offline
external usenet poster
 
Posts: 197
Default Macro - filter - show all data

Hi
I have the spreadsheet with the macro that does number of things, but I am
not using it - only somebody else. The problem is that this person uses it
then from time to time uses a filter and if data are filtered the macro
crashes. I tried use "show all data" in the macro, but it crashes when there
is not filter used.
Is there a way to change the macro so if there is a filter used then
unfilter it, but if not do not change anything?

I am still on the learning curve with the VBA.
--
Greatly appreciated
Eva
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Macro - filter - 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

Eva wrote:

Hi
I have the spreadsheet with the macro that does number of things, but I am
not using it - only somebody else. The problem is that this person uses it
then from time to time uses a filter and if data are filtered the macro
crashes. I tried use "show all data" in the macro, but it crashes when there
is not filter used.
Is there a way to change the macro so if there is a filter used then
unfilter it, but if not do not change anything?

I am still on the learning curve with the VBA.
--
Greatly appreciated
Eva


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Eva Eva is offline
external usenet poster
 
Posts: 197
Default Macro - filter - show all data

Works like a charm!
Thank you very much

--
Greatly appreciated
Eva


"Dave Peterson" wrote:

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

Eva wrote:

Hi
I have the spreadsheet with the macro that does number of things, but I am
not using it - only somebody else. The problem is that this person uses it
then from time to time uses a filter and if data are filtered the macro
crashes. I tried use "show all data" in the macro, but it crashes when there
is not filter used.
Is there a way to change the macro so if there is a filter used then
unfilter it, but if not do not change anything?

I am still on the learning curve with the VBA.
--
Greatly appreciated
Eva


--

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
How to show data based on pivottable filter? Manny Excel Discussion (Misc queries) 2 June 24th 09 05:58 PM
Why don't all my data rows show up in auto-filter? anromath Excel Worksheet Functions 7 April 16th 07 05:46 PM
Auto Filter does not show all the data in the column Char Excel Worksheet Functions 2 October 3rd 06 03:34 PM
Why would Show All not be active in Filter part of Data menu? Larry Excel Worksheet Functions 1 August 30th 06 10:16 PM
Shortcut Key for Data-Filter-Show All? Andrew Excel Discussion (Misc queries) 4 March 30th 06 11:29 PM


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