Hi, Cammandk,
there were some minor blinks with the code but it´s your data on the sheets that gives no matches...
Sub EF982445_2()
Dim rngCell As Range
Dim wsTarg As Worksheet
Dim rngFound As Range
Const cstrCOL_SHEET As String = "D" '"B"
Const cstrCOL_ID As String = "E" '"C"
Const cstrCOL_TYPE As String = "I"
Const cstrCOL_AMOUNT As String = "U"
Const cstrCOL_TARG As String = "AR"
Const clngSTART As Long = 6
With Sheets("AP")
On Error Resume Next
For Each rngCell In .Range("W" & clngSTART, .Range("W" & Rows.Count).End(xlUp)).SpecialCells(xlCellTypeConstants, 23)
If rngCell.Value = "PAID" Then
If Not Evaluate("ISREF('" & .Cells(rngCell.Row, cstrCOL_SHEET).Value & "'!A1)") Then
Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = .Cells(rngCell.Row, cstrCOL_SHEET).Value
End If
Set wsTarg = Sheets(.Cells(rngCell.Row, cstrCOL_SHEET).Value)
Set rngFound = wsTarg.Cells(1, cstrCOL_ID).EntireColumn.Find(What:=.Cells(rngCell.Row, cstrCOL_ID), LookAt:=xlValue)
If Not rngFound Is Nothing Then
If wsTarg.Cells(rngFound.Row, cstrCOL_TYPE).Value = .Cells(rngCell.Row, cstrCOL_TYPE).Value Then
If wsTarg.Cells(rngFound.Row, cstrCOL_AMOUNT).Value = .Cells(rngCell.Row, cstrCOL_AMOUNT).Value Then
wsTarg.Cells(rngFound.Row, cstrCOL_TARG).Value = "PAID"
End If
End If
End If
End If
Next rngCell
If Err <> 0 Then
MsgBox "No values to work from found on Sheet '" & .Name & "' in Column W!"
End If
End With
End Sub
Ciao,
Holger
Bookmarks