I need to find the date groups from a series of dates in a row. As you can see below, I have a series of dates that come from an On-Call schedule using the Macro below. What I need it to do is look at the string of dates and pull out the newest and the oldest dates for each time period, example:
From the dates below, I need it to display the dates like this:
Columns A B C
Person 1 1/10/2013 To 1/16/2013 1/24/2013 To 1/30/2013 3/21/2013 To 3/27/2013
Person 2 1/10/2013 To 2/9/2013
Person 1 Schedule all in one row in a cell each
1/10/2013 1/11/2013 1/12/2013 1/13/2013 1/14/2013 1/15/2013 1/16/2013 1/24/2013 1/25/2013 1/26/2013 1/27/2013 1/28/2013 1/29/2013 1/30/2013 3/21/2013 3/22/2013 3/23/2013 3/24/2013 3/25/2013 3/26/2013 3/27/2013
Person 2 Schedule all in one row in a cell each
1/10/2013 1/11/2013 1/12/2013 1/13/2013 1/14/2013 1/15/2013 1/16/2013 1/17/2013 1/18/2013 1/19/2013 1/20/2013 1/21/2013 1/22/2013 1/23/2013 1/24/2013 1/25/2013 1/26/2013 1/27/2013 1/28/2013 1/29/2013 1/30/2013 2/1/2013 2/2/2013 2/3/2013 2/4/2013 2/5/2013 2/6/2013 2/7/2013 2/8/2013 2/9/2013
I do not need the dates in-between the dates populated in a cell, all I want is just to split out the beginning and the end dates.
Is this possible to do?
I am working with Excel 2007
Thank you for your time!
Sub aaa()
Dim OutSh As Worksheet
Set OutSh = Sheets("Sheet7")
For Each ce In Range("B4:US9")
Set findit = OutSh.Range("A:A").Find(what:=ce.Value)
If findit Is Nothing Then
OutSh.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Value = ce.Value
Set findit = OutSh.Range("A:A").Find(what:=ce.Value)
End If
OutSh.Cells(findit.Row, Columns.Count).End(xlToLeft).Offset(0, 1).Value = Cells(12, ce.Column).Value
Next ce
End Sub
Bookmarks