Hi!
I have this code:
Sub Macro4()
'
' Macro4 Macro
'
'
Range("A1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$E$25").AutoFilter Field:=1, Criteria1:="16/08/2008", _
Operator:=xlAnd
End Sub
Instead of having to insert "16/08/2008" as Criteria1, I would like to have a variable in there corresponding to the maximum value of a column containing dates.
Could anyone help? That would be extremely helpful and very much appreciated...
In this case the maximum would correspond to the most recent date in the DATE column....
DATE SELLER ITEM QUANTITY PRICE
01.01.2008 John SHOES 10 100
02.01.2008 John TROWSERS 20 110
03.01.2008 John SHIRTS 10 80
04.01.2008 John JEANS 25 90
05.01.2008 John SOCKS 20 95
06.01.2008 John SHOES 32 75
07.01.2008 John TROWSERS 45 65
08.01.2008 John SHIRTS 11 95
09.01.2008 John JEANS 12 12
10.01.2008 John SOCKS 14 13
11.01.2008 John SOCKS 10 100
12.01.2008 John SHOES 20 110
12.01.2008 John TROWSERS 10 80
12.01.2008 John SHIRTS 25 90
13.01.2008 John JEANS 20 95
14.01.2008 John SOCKS 32 75
15.01.2008 John SOCKS 45 65
16.01.2008 John SHOES 11 95
16.01.2008 John TROWSERS 12 12
16.01.2008 John SHIRTS 14 13
Thank you again...
I have this code:
Sub Macro4()
'
' Macro4 Macro
'
'
Range("A1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$E$25").AutoFilter Field:=1, Criteria1:="16/08/2008", _
Operator:=xlAnd
End Sub
Instead of having to insert "16/08/2008" as Criteria1, I would like to have a variable in there corresponding to the maximum value of a column containing dates.
Could anyone help? That would be extremely helpful and very much appreciated...
In this case the maximum would correspond to the most recent date in the DATE column....
DATE SELLER ITEM QUANTITY PRICE
01.01.2008 John SHOES 10 100
02.01.2008 John TROWSERS 20 110
03.01.2008 John SHIRTS 10 80
04.01.2008 John JEANS 25 90
05.01.2008 John SOCKS 20 95
06.01.2008 John SHOES 32 75
07.01.2008 John TROWSERS 45 65
08.01.2008 John SHIRTS 11 95
09.01.2008 John JEANS 12 12
10.01.2008 John SOCKS 14 13
11.01.2008 John SOCKS 10 100
12.01.2008 John SHOES 20 110
12.01.2008 John TROWSERS 10 80
12.01.2008 John SHIRTS 25 90
13.01.2008 John JEANS 20 95
14.01.2008 John SOCKS 32 75
15.01.2008 John SOCKS 45 65
16.01.2008 John SHOES 11 95
16.01.2008 John TROWSERS 12 12
16.01.2008 John SHIRTS 14 13
Thank you again...