Hi all,
I am trying to pull the date from the top in row 17 to another sheet if there is a value in row 21 and if Q21 = OCP
In addition I want the date to go to one of the following cells and fill from top down. For example in the above picture it would only pull the date from R17, T17, V17 and put it in A6,A8,A10.
Here is the code I have come up with so far. This returns the date of 4/18 all the way down in the image above.
Any help would be greatly appreciated.
I am trying to pull the date from the top in row 17 to another sheet if there is a value in row 21 and if Q21 = OCP
In addition I want the date to go to one of the following cells and fill from top down. For example in the above picture it would only pull the date from R17, T17, V17 and put it in A6,A8,A10.
Here is the code I have come up with so far. This returns the date of 4/18 all the way down in the image above.
Any help would be greatly appreciated.
VBA Code:
Sub OCPumping_If()
Dim cell As Range
Dim Cells As Range
Dim Code As Range
Dim Block As Range
For Each cell In Range("'Wk 1'!R21:AA21")
For Each Code In Range("'Wk 1'!Q21")
For Each Cells In Range("'Wk 1'!R17:AA17")
For Each Block In Range("'OCP Wk 1'!A6:A20")
If cell.Value <> "" And Code.Value = "OCP" Then
Block.Value = Cells.Value
End If
Next
Next
Next
Next
End Sub