View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Pesky Autofilter Toggle

Both work for me

Testing for autofiltermode test if the "dropdown arrows are visible..
(programmatically you can set an autofilter without showing the dropdowns)

Thus you'll need to TEST on the filtermode.

If ActiveSheet.FilterMode Then
ActiveSheet.FilterMode = False
End If


To remove the SHEET's autofilter you COULD also call
RANGE's autofilter method with NO argument

Range("a1").autofilter




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam

Digory wrote in message
:


Help for a VBA newbie – I am taking two databases and using filters to
sort and copy data to one of 24 worksheets depending on filter
criteria. Seems to be going ok but would appreciate some advice on
autofilters. Am currently selecting row then turning on autofilter –
however this seems to toggle the filter (if its already on then this
turns it off & vice versa) so if an autofliter has been left on
somewhere in workbook its back to debugger. How do I switch it off
rather than toggle off ?

I am also using this macro to set the print area for each of my 24
worksheets by first estimating the likely number of rows (columns are
fixed) but as my database grows I am mindful that I will need to keep
resetting this value. Can I use the COUNTA function to count rows so
that my set print area is more dynamic ?

Finally, was wondering if there is a way in VBA to search for a cell
value and make that cell really stand out (perhaps flash) ? Am using
conditional formatting (three conditions) for row colours but need
another condition to highlight specific cell entries.

Many thanks
D:-)