Re: Setting a Range of Fill Dates
Ok I have it working except for one glitch the closing date unfortunately if teh closing date is 200504 the macro fills the date up till 200503 instead of 200504. 
I created two macro this first one is to fill the dates and the account number
Sub Dates2()
Sheets("Sheet1").Select
Range("B1").Select
Selection.copy
Sheets("Sheet2").Select
Range("A1").Select
ActiveSheet.Paste
Sheets("Sheet2").Select
Range("B1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "Nstatement"
Sheets("Sheet2").Select
Range("C1").Select
ActiveCell.FormulaR1C1 = "Composite 1"
Range("D1").Select
ActiveCell.FormulaR1C1 = "Composite 2"
Range("C1:D1").Select
Selection.AutoFill Destination:=Range("C1:R1"), Type:=xlFillDefault
Range("C1:R1").Select
Dim wsSource As Worksheet, wsTarget As Worksheet
Dim rLastRow As Long, rSourceRow As Long, rTargetRow As Long
Dim iCurrYear As Integer, iCurrMonth As Integer
Dim iLastYear As Integer, iLastMonth As Integer
Dim szDate As String
Set wsSource = ThisWorkbook.Worksheets("sheet1")
Set wsTarget = ThisWorkbook.Worksheets("sheet2")
' Find last row
With wsSource
rLastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
End With
rTargetRow = 2
For rSourceRow = 2 To rLastRow
With wsSource
' Column "D" is the 4th column
With .Cells(rSourceRow, 4)
If (.Value = "") Then
MsgBox ("D" & rSourceRow & " is empty")
Exit Sub
End If
iCurrYear = Left(.Value, 4)
iCurrMonth = Right(.Value, 2)
End With
' Column "I" is the 9th column
With .Cells(rSourceRow, 9)
If (.Value = "") Then
iLastYear = 2006
iLastMonth = 6
Else
iLastYear = Left(.Value, 4)
iLastMonth = Right(.Value, 2)
End If
End With
Do Until (iCurrYear >= iLastYear And iCurrMonth >= iLastMonth)
szDate = iCurrYear & Right("00" & iCurrMonth, 2)
' Column "A" & "B" are the 1st & 2nd columns, respectively
wsTarget.Cells(rTargetRow, 1).Value = .Cells(rSourceRow, 2).Value
wsTarget.Cells(rTargetRow, 2).Value = szDate
rTargetRow = rTargetRow + 1
If (iCurrMonth = 12) Then
iCurrMonth = 1
iCurrYear = iCurrYear + 1
Else
iCurrMonth = iCurrMonth + 1
End If
Loop
End With
Next rSourceRow
End Sub
Display More
and this second one is to fill the criteria which works perfectly, I know I probably designed it the loong way 
Sub NoL2()
Dim wsSource As Worksheet
Dim wsTarget As Worksheet
Dim Acomp As Long
Dim Bcomp As Long
Dim rLastRow As Long
Dim rSourceRow As Long
Dim rTargetRow As Long
Set wsSource = ThisWorkbook.Worksheets("sheet1")
Set wsTarget = ThisWorkbook.Worksheets("sheet2")
'Find Last Row
With wsSource
rLastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
End With
rTargetRow = 2
For rSourceRow = 2 To rLastRow
With wsSource
' Column "d" is the 4th column
With .Cells(rSourceRow, 4)
If (.Value = "") Then
MsgBox ("D" & rSourceRow & "is empty")
Exit Sub
End If
End With
Do While wsSource.Range("b" & rSourceRow) = wsTarget.Range("A" & rTargetRow)
If wsSource.Range("O" & rSourceRow) = wsTarget.Range("C1") Or wsTarget.Range("C1") = wsSource.Range("P" & rSourceRow) Then
wsTarget.Cells(rTargetRow, 3).Value = "yes"
Else
wsTarget.Cells(rTargetRow, 3).Value = "no"
End If
If wsSource.Range("O" & rSourceRow) = wsTarget.Range("d1") Or wsTarget.Range("d1") = wsSource.Range("P" & rSourceRow) Then
wsTarget.Cells(rTargetRow, 4).Value = "yes"
Else
wsTarget.Cells(rTargetRow, 4).Value = "no"
End If
If wsSource.Range("O" & rSourceRow) = wsTarget.Range("e1") Or wsTarget.Range("e1") = wsSource.Range("P" & rSourceRow) Then
wsTarget.Cells(rTargetRow, 5).Value = "yes"
Else
wsTarget.Cells(rTargetRow, 5).Value = "no"
End If
If wsSource.Range("O" & rSourceRow) = wsTarget.Range("f1") Or wsTarget.Range("f1") = wsSource.Range("P" & rSourceRow) Then
wsTarget.Cells(rTargetRow, 6).Value = "yes"
Else
wsTarget.Cells(rTargetRow, 6).Value = "no"
End If
If wsSource.Range("O" & rSourceRow) = wsTarget.Range("g1") Or wsTarget.Range("g1") = wsSource.Range("P" & rSourceRow) Then
wsTarget.Cells(rTargetRow, 7).Value = "yes"
Else
wsTarget.Cells(rTargetRow, 7).Value = "no"
End If
If wsSource.Range("O" & rSourceRow) = wsTarget.Range("h1") Or wsTarget.Range("h1") = wsSource.Range("P" & rSourceRow) Then
wsTarget.Cells(rTargetRow, 8).Value = "yes"
Else
wsTarget.Cells(rTargetRow, 8).Value = "no"
End If
If wsSource.Range("O" & rSourceRow) = wsTarget.Range("i1") Or wsTarget.Range("i1") = wsSource.Range("P" & rSourceRow) Then
wsTarget.Cells(rTargetRow, 9).Value = "yes"
Else
wsTarget.Cells(rTargetRow, 9).Value = "no"
End If
If wsSource.Range("O" & rSourceRow) = wsTarget.Range("j1") Or wsTarget.Range("j1") = wsSource.Range("P" & rSourceRow) Then
wsTarget.Cells(rTargetRow, 10).Value = "yes"
Else
wsTarget.Cells(rTargetRow, 10).Value = "no"
End If
If wsSource.Range("O" & rSourceRow) = wsTarget.Range("k1") Or wsTarget.Range("k1") = wsSource.Range("P" & rSourceRow) Then
wsTarget.Cells(rTargetRow, 11).Value = "yes"
Else
wsTarget.Cells(rTargetRow, 11).Value = "no"
End If
If wsSource.Range("O" & rSourceRow) = wsTarget.Range("l1") Or wsTarget.Range("l1") = wsSource.Range("P" & rSourceRow) Then
wsTarget.Cells(rTargetRow, 12).Value = "yes"
Else
wsTarget.Cells(rTargetRow, 12).Value = "no"
End If
If wsSource.Range("O" & rSourceRow) = wsTarget.Range("m1") Or wsTarget.Range("m1") = wsSource.Range("P" & rSourceRow) Then
wsTarget.Cells(rTargetRow, 13).Value = "yes"
Else
wsTarget.Cells(rTargetRow, 13).Value = "no"
End If
If wsSource.Range("O" & rSourceRow) = wsTarget.Range("n1") Or wsTarget.Range("n1") = wsSource.Range("P" & rSourceRow) Then
wsTarget.Cells(rTargetRow, 14).Value = "yes"
Else
wsTarget.Cells(rTargetRow, 14).Value = "no"
End If
If wsSource.Range("O" & rSourceRow) = wsTarget.Range("o1") Or wsTarget.Range("o1") = wsSource.Range("P" & rSourceRow) Then
wsTarget.Cells(rTargetRow, 15).Value = "yes"
Else
wsTarget.Cells(rTargetRow, 15).Value = "no"
End If
If wsSource.Range("O" & rSourceRow) = wsTarget.Range("p1") Or wsTarget.Range("p1") = wsSource.Range("P" & rSourceRow) Then
wsTarget.Cells(rTargetRow, 16).Value = "yes"
Else
wsTarget.Cells(rTargetRow, 16).Value = "no"
End If
If wsSource.Range("O" & rSourceRow) = wsTarget.Range("q1") Or wsTarget.Range("q1") = wsSource.Range("P" & rSourceRow) Then
wsTarget.Cells(rTargetRow, 17).Value = "yes"
Else
wsTarget.Cells(rTargetRow, 17).Value = "no"
End If
If wsSource.Range("O" & rSourceRow) = wsTarget.Range("r1") Or wsTarget.Range("r1") = wsSource.Range("P" & rSourceRow) Then
wsTarget.Cells(rTargetRow, 18).Value = "yes"
Else
wsTarget.Cells(rTargetRow, 18).Value = "no"
End If
rTargetRow = rTargetRow + 1
Loop
End With
Next rSourceRow
End Sub
Display More
Any help would be greatly appreciated fixing this minor detail.
Im attaching a sample of the file THANKYOU !!