Hi All
I have the following macro but now I need to add in one more criteria that is when the cell in column D = "Unknown" and also the cell in column P = "Complete", please could anyone help to edit the macro. Many thanks.
I have the following macro but now I need to add in one more criteria that is when the cell in column D = "Unknown" and also the cell in column P = "Complete", please could anyone help to edit the macro. Many thanks.
VBA Code:
Dim c As Range, aryD As Variant, aryS As Variant, r As Long, sh1 As Worksheet, sh2 As Worksheet, i As Long
aryD = Array("A", "B", "C", "D", "E")
aryS = Array(1, 2, 3, 17, 15)
Set sh1 = Sheets("Previous Data")
Set sh2 = Sheets("RAG Status Unknown")
With sh1
r = 4
For Each c In .Range("D2", .Cells(Rows.Count, 4).End(xlUp))
If c = "Unknown" Then
For i = LBound(aryS) To UBound(aryS)
sh2.Range(aryD(i) & r) = sh1.Cells(c.row, aryS(i)).Value
Next
r = r + 1
End If
Next
End With