Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 477
Default Unique Output is Duplicating minimum date value

I have 8 dates in a Range A2:A9 (A1 is header) like so,, (4 are unique)

MyDates
12/31/2006
1/25/2007
12/31/2006
1/15/2007
1/15/2007
12/31/2006
1/25/2007
2/15/2007


Sub Macro5()
'
' Macro5 Macro
' Macro recorded 8/21/2007 by Jim May
'
ActiveCell.Range("A1:A9").Select
Selection.Sort Key1:=ActiveCell, Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveCell.Offset(1, 0).Range("A1:A8").AdvancedFilter
Action:=xlFilterCopy, _
CopyToRange:=ActiveCell.Offset(1, 2).Range("A1"), Unique:=True
End Sub

The Above produces:

12/31/2006 << need to eliminate this guy obviously - but how?
12/31/2006
1/15/2007
01/25/2007
2/15/2007


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Unique Output is Duplicating minimum date value

Jim,

Try this

Sub Macro5()
ActiveCell.Range("A2:A9").Select
Selection.Sort Key1:=ActiveCell, Order1:=xlAscending
Range("A1:A10").AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Range("C1"), Unique:=True
End Sub

Mike

"Jim May" wrote:

I have 8 dates in a Range A2:A9 (A1 is header) like so,, (4 are unique)

MyDates
12/31/2006
1/25/2007
12/31/2006
1/15/2007
1/15/2007
12/31/2006
1/25/2007
2/15/2007


Sub Macro5()
'
' Macro5 Macro
' Macro recorded 8/21/2007 by Jim May
'
ActiveCell.Range("A1:A9").Select
Selection.Sort Key1:=ActiveCell, Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveCell.Offset(1, 0).Range("A1:A8").AdvancedFilter
Action:=xlFilterCopy, _
CopyToRange:=ActiveCell.Offset(1, 2).Range("A1"), Unique:=True
End Sub

The Above produces:

12/31/2006 << need to eliminate this guy obviously - but how?
12/31/2006
1/15/2007
01/25/2007
2/15/2007


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 477
Default Unique Output is Duplicating minimum date value

Mike - Thanks !!

"Mike H" wrote:

Jim,

Try this

Sub Macro5()
ActiveCell.Range("A2:A9").Select
Selection.Sort Key1:=ActiveCell, Order1:=xlAscending
Range("A1:A10").AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Range("C1"), Unique:=True
End Sub

Mike

"Jim May" wrote:

I have 8 dates in a Range A2:A9 (A1 is header) like so,, (4 are unique)

MyDates
12/31/2006
1/25/2007
12/31/2006
1/15/2007
1/15/2007
12/31/2006
1/25/2007
2/15/2007


Sub Macro5()
'
' Macro5 Macro
' Macro recorded 8/21/2007 by Jim May
'
ActiveCell.Range("A1:A9").Select
Selection.Sort Key1:=ActiveCell, Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveCell.Offset(1, 0).Range("A1:A8").AdvancedFilter
Action:=xlFilterCopy, _
CopyToRange:=ActiveCell.Offset(1, 2).Range("A1"), Unique:=True
End Sub

The Above produces:

12/31/2006 << need to eliminate this guy obviously - but how?
12/31/2006
1/15/2007
01/25/2007
2/15/2007


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
Minimum Date Greater Than Observation Start Date vito Excel Discussion (Misc queries) 2 August 14th 07 03:02 PM
Output client name based on date... Ted McCastlain Excel Worksheet Functions 0 September 5th 06 09:15 PM
Getting the value of the Minimum Date Kurt Excel Worksheet Functions 3 July 26th 06 01:52 PM
Minimum date greater than a specific date. Joker Excel Discussion (Misc queries) 3 January 11th 06 12:56 PM
Minimum Date Range from other cells JLT Excel Worksheet Functions 1 January 1st 06 08:29 PM


All times are GMT +1. The time now is 05:16 PM.

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"