Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Displaying date in filter criteria

Hi All,

I am using the magnificent FilterCriteria tip as per
http://j-walk.com/ss/excel/usertips/tip044.htm
to display the filter criteria being used in AutoFilters.

A question was asked on my blog about displaying the filter criteria
as a date - if it is a date.
http://robertmarkbramprogrammer.blog...omment-5150203

I.e. if I were to apply a custom filter: "is less than 15/01/2009",
this is displayed: "<39828"

Is there a way to change the macro code perhaps (or cell formatting)
to make that "< 15/01/2009" instead?

Thanks for any assistance!

Rob
:)
  #2   Report Post  
Posted to microsoft.public.excel.misc
JB JB is offline
external usenet poster
 
Posts: 115
Default Displaying date in filter criteria

Hello,

http://cjoint.com/?bshTcTRKcM
http://boisgontierjacques.free.fr/pa...FiltreAuto.htm

Function FiltreActuel(feuille, c As String, Optional typeCol As
String)
Application.Volatile
n = Sheets(feuille).Range("_FilterDataBase").Columns.C ount
col = Application.Match(c, Sheets(feuille).Range
("_FilterDataBase").Cells(1, 1).Resize(1, n), 0)
If Sheets(feuille).FilterMode Then
If Sheets(feuille).AutoFilter.Filters.Item(col).On Then
temp = Sheets(feuille).AutoFilter.Filters.Item(col).Crite ria1
If Left(temp, 2) = "=" Or Left(temp, 2) = "<=" Then
o = Left(temp, 2): n = Mid(temp, 3)
Else
If Left(temp, 1) = "=" Or Left(temp, 1) = "" Or Left(temp,
1) = "<" Then
o = Left(temp, 1): n = Mid(temp, 2)
Else
n = temp
End If
End If
If typeCol = "D" Then n = Format(n, "dd/mm/yy")
temp = o & n
'---
If Sheets(feuille).AutoFilter.Filters.Item(col).Opera tor Then
oper = IIf(Sheets(feuille).AutoFilter.Filters.Item
(col).Operator = 1, " ET ", " OU ")
On Error Resume Next
Err = 0
temp2 = Sheets(feuille).AutoFilter.Filters.Item
(col).Criteria2
If Err = 0 Then
If Left(temp2, 2) = "=" Or Left(temp2, 2) = "<=" Then
o = Left(temp2, 2): n = Mid(temp2, 3)
Else
If Left(temp2, 1) = "=" Or Left(temp2, 1) = "" Or Left
(temp2, 1) = "<" _
Then o = Left(temp2, 1): n = Mid(temp2, 2)
End If
If typeCol = "D" Then n = Format(n, "dd/mm/yy")
temp2 = o & n
Else
oper = ""
End If
End If
FiltreActuel = temp & oper & temp2
Else
FiltreActuel = ""
End If
Else
FiltreActuel = ""
End If
End Function

JB
http://boisgontierjacques.free.fr


On 16 jan, 01:03, Robert Mark Bram wrote:
Hi All,

I am using the magnificent FilterCriteria tip as perhttp://j-walk.com/ss/excel/usertips/tip044.htm
to display the filter criteria being used in AutoFilters.

A question was asked on my blog about displaying the filter criteria
as a date - if it is a date.http://robertmarkbramprogrammer.blog...cel-displaying...

I.e. if I were to apply a custom filter: "is less than 15/01/2009",
this is displayed: "<39828"

Is there a way to change the macro code perhaps (or cell formatting)
to make that "< 15/01/2009" instead?

Thanks for any assistance!

Rob
:)


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Displaying date in filter criteria


A question was asked on my blog about displaying the filter criteria
as a date - if it is a date.http://robertmarkbramprogrammer.blog...cel-displaying...


I.e. if I were to apply a custom filter: "is less than 15/01/2009",
this is displayed: "<39828"


Is there a way to change the macro code perhaps (or cell formatting)
to make that "< 15/01/2009" instead?


http://cjoint.com/?bshTcTRKcMhttp://...FiltreAuto.htm


Thank you JB!
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
Auto Filter Not Displaying all results Excel novice Excel Discussion (Misc queries) 1 January 11th 07 06:17 PM
Help with using filter criteria with date [email protected] Excel Worksheet Functions 1 December 14th 05 07:31 PM
Auto filter not displaying number of results in status bar. Alex Lush Excel Discussion (Misc queries) 3 August 30th 05 06:12 PM
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du TC Excel Worksheet Functions 1 May 12th 05 02:06 AM
Displaying autofilter criteria [email protected] Excel Worksheet Functions 0 February 25th 05 09:41 PM


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