LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Strange behaviour of autofilter

HI everyone,
I happen to encounter a - in my eyes - really strange behaviour of
excel in reaction to a macro.

The sub in question should set an auto filter on a column to show all
entries with a late smaller or equal to today. And in case the
autofilter is already set deactivate it upon execution.

However when I run the sub no rows at all are displayed even not those
which should be. However when I look at the autofilter settings,
change nothing and just press ok. Then it works as it should. So I
wonder what's up here? I'd really appreciate input on this as I just
ran out of ideas.

Here is the code in question

Sub ShowCurrentTasks()

If (ActiveSheet.AutoFilter.Filters(4).On) Then
Selection.AutoFilter Field:=4
Else
Selection.AutoFilter Field:=4, Criteria1:="<=" & Date,
Operator:=xlAnd
End If
End Sub


Cheers,
Lars

 
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
Strange Page Break behaviour while AutoFilter enabled jaymz1102 Excel Discussion (Misc queries) 0 September 9th 08 01:40 PM
Strange VBA Behaviour Ricko Excel Programming 0 July 28th 05 07:53 AM
Strange behaviour Edgar Thoemmes Excel Worksheet Functions 1 February 8th 05 03:20 PM
Strange behaviour in VBA Help Michael Singmin Excel Programming 4 June 4th 04 07:06 PM
strange behaviour Patrick Molloy Excel Programming 0 September 4th 03 07:51 AM


All times are GMT +1. The time now is 02:35 AM.

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"