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

I have some quite complex filters and am trying to make the spreadsheet more
user friendly.

I have included a button to restore the Show All Data using the VBA:

ActiveSheet.ShowAllData

This works, but only if there has been a filter applied. If the user clicks
the button again (without a filter being present) I get the following error
message - "Run Time error 1004 - ShowAllData method of Worksheet class
failed".

How can I stop this error message, or better still advise the user (MSGBOX?)
that all the data is currently being shown?

Thank you for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Show All Data

maybe something like this

If ActiveSheet.AutoFilterMode = True Then
ActiveSheet.ShowAllData
End If

--


Gary


"B Baggins" wrote in message
...
I have some quite complex filters and am trying to make the spreadsheet more
user friendly.

I have included a button to restore the Show All Data using the VBA:

ActiveSheet.ShowAllData

This works, but only if there has been a filter applied. If the user clicks
the button again (without a filter being present) I get the following error
message - "Run Time error 1004 - ShowAllData method of Worksheet class
failed".

How can I stop this error message, or better still advise the user (MSGBOX?)
that all the data is currently being shown?

Thank you for your help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Show All Data

if activesheet.filtermode then
activesheet.showAlldata
End if

--
Regards,
Tom Ogilvy


"B Baggins" wrote:

I have some quite complex filters and am trying to make the spreadsheet more
user friendly.

I have included a button to restore the Show All Data using the VBA:

ActiveSheet.ShowAllData

This works, but only if there has been a filter applied. If the user clicks
the button again (without a filter being present) I get the following error
message - "Run Time error 1004 - ShowAllData method of Worksheet class
failed".

How can I stop this error message, or better still advise the user (MSGBOX?)
that all the data is currently being shown?

Thank you for your help.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Show All Data

sorry, should have posted this

If ActiveSheet.FilterMode = True Then
ActiveSheet.ShowAllData
End If


--


Gary


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
maybe something like this

If ActiveSheet.AutoFilterMode = True Then
ActiveSheet.ShowAllData
End If

--


Gary


"B Baggins" wrote in message
...
I have some quite complex filters and am trying to make the spreadsheet more
user friendly.

I have included a button to restore the Show All Data using the VBA:

ActiveSheet.ShowAllData

This works, but only if there has been a filter applied. If the user clicks
the button again (without a filter being present) I get the following error
message - "Run Time error 1004 - ShowAllData method of Worksheet class
failed".

How can I stop this error message, or better still advise the user (MSGBOX?)
that all the data is currently being shown?

Thank you for your help.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Show All Data

Sub Makro2()

If ActiveSheet.FilterMode = False Then
MsgBox "No filter !"
ElseIf ActiveSheet.FilterMode = True Then
ActiveSheet.ShowAllData
Else
MsgBox "unknown case"
End If


End Sub




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Show All Data

Thanks everyone - works perfectly
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
Pivot Tables: Don't show data for detail, but still show subtotals Lynndyhop Excel Worksheet Functions 3 February 8th 10 11:51 AM
Data Labels- POssible to show data value and data label together? kippers Charts and Charting in Excel 1 April 1st 09 01:33 PM
Pivot tables - how to show only show data or < $10k pattyb Excel Discussion (Misc queries) 2 December 19th 08 09:30 PM
show 3 sets of data per data point in a scatter plot Marie Charts and Charting in Excel 6 May 19th 08 09:38 PM
how do i sort a worksheet data to show repetitve data and show mrcheatherington Excel Worksheet Functions 1 December 30th 07 02:26 PM


All times are GMT +1. The time now is 03:40 PM.

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

About Us

"It's about Microsoft Excel"