So you want to compare Sheet1 column P with Sheet2 column Q.
When they are the same, remove contents from Sheet2 column P and Q.
If this is true then the following code will work:
Dim lRow As Long
lRow = Range("P" & Rows.Count).End(xlUp).Row
For Each cell In Range("P2:P" & lRow) 'Assuming you have a 1 row header
If cell.Value = Sheets("Sheet2").Cells(cell.Row, "Q") Then
Sheets("Sheet2").Range(Cells(cell.Row, "P"), Cells(cell.Row, "Q")).ClearContents
To make the first code work, try replacing Integer with Long in the second code line.