Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How? - Error message for turning off autofilter with code

I have a button on a worksheet to 'Show All Records'.

There are two ways i found to do it, ie:

ActiveSheet.ShowAllData

and

If ActiveSheet.AutoFilterMode Then
ActiveSheet.AutoFilterMode = False
End If

How do I display a message box saying "All records shown" if the use
clicks the button when the records are not filtered?

I found that the second way erases the filter arrows. I would like th
filter arrows at the top to remain.

Would appreciate anyones help, thanks

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How? - Error message for turning off autofilter with code

This is one of those macros that I have been meaning to get round to an
not found the necessary motivation. It now resides in my personal.xls.

To check if a filter has been set beforehand it would be necessary t
run the same loop, so there is no point. This will work in any case :-


Code
-------------------

'------------------------------------------------
Sub AUTOFILTER_RESET()
Dim MyFilter As Range
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Set MyFilter = ActiveSheet.AutoFilter.Range
cols = MyFilter.Columns.Count
'-----------------------------------
For c = 1 To cols
MyFilter.AutoFilter field:=c
Next
'-----------------------------------
Application.ScreenUpdating = True
MsgBox ("All data visible.")
Application.Calculation = xlCalculationAutomatic
End Sub
'-------------------------------------------------

-------------------


--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How? - Error message for turning off autofilter with code

This works for me.

Thank you very much!

ryss

--
Message posted from http://www.ExcelForum.com

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
Turning off this message? Terry Pinnell[_2_] Excel Discussion (Misc queries) 2 September 6th 11 03:45 PM
Code has been interupted - error message Jeff Excel Discussion (Misc queries) 0 May 10th 07 03:23 PM
Turning off merge message David P. Excel Discussion (Misc queries) 5 December 30th 05 06:42 PM
turning off trace dependents error message D Griffith Setting up and Configuration of Excel 0 May 3rd 05 05:51 PM
Turning Off AutoFilter With Code Howard Brody Excel Programming 0 August 11th 03 06:49 PM


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