I'm really struggling with this problem.
I am trying to match dates between dates listed by day (column A) with dates listed by week (column E). Once a match is made, I want to copy the weekly date and associated data (e.g. cells E1 and F1) to the row of the date listed by day (columns C and D). Then I need to move onto the next date listed by week.
The data by a weekly date has a maximum of 300 items (rows).
The weekly date is always a Friday. If the Friday was a holiday day and there is no match, then I need to take the preceding date from the dates listed by day in column A.
The code I have developed so far is shown below but I have got stuck with the problem
I have also attached a spreadsheet showing the problem with data and the outcome of what I am trying to achieve.
Sub Aligndates()
Dim c As Long
Dim ccheck As Long
Dim RngOutput
LastRow = Range("c300")
For c = 1 To LastRow
Range("a1").Select
Do
If ActiveCell.Value = Cells(c, 1) Then
Cells(c, 1).Copy
ActiveCell.Offset(1, 0).Paste
Else
ActiveCell.Offset(1, 0).Select
Loop Until ActiveCell.Value = Range.("c").Value
End If
Next ccheck
End Sub
Display More