1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| Dim l As Integer
Dim longer As Integer
longer = Sheets("caresrpt.cfm-2").Range("Q65000").End(xlUp).Row
With Sheets("AR_WOH_OpenClosed_P1toP2")
For l = 3 To .Range("a65000").End(xlUp).Row
For i = 7 To longer
If Sheets("caresrpt.cfm-2").Cells(i, 3) < "3" Then
If Sheets("caresrpt.cfm-2").Cells(i, 17) = Sheets("AR_WOH_OpenClosed_P1toP2").Cells(l - 1, 1) Then
.Cells(l - 1, 2) = .Cells(l - 1, 2) + 1
End If
If Sheets("caresrpt.cfm-2").Cells(i, 24) = Sheets("AR_WOH_OpenClosed_P1toP2").Cells(l - 1, 1) Then
.Cells(l - 1, 3) = .Cells(l - 1, 3) + 1
End If
End If
Next i
.Cells(l - 1, 4) = .Cells(l - 1, 2) - .Cells(l - 1, 3)
Next l
For l = 3 To .Range("a65000").End(xlUp).Row
.Cells(2, 5) = .Cells(2, 2)
.Cells(2, 6) = .Cells(2, 3)
.Cells(2, 7) = .Cells(2, 4)
.Cells(l, 5) = .Cells(l, 2) + .Cells(l - 1, 5)
.Cells(l, 6) = .Cells(l, 3) + .Cells(l - 1, 6)
.Cells(l, 7) = .Cells(l, 4) + .Cells(l - 1, 7)
Next l
End With |