Why are you using the workbook_sheetdeactivate event? You can use it as normal sub-routine as in Sub copy_data(). This could be slowing down your code.

To clear the contents of the master sheet, use this updated code
Private Sub copy_data()
Dim i As Long
Dim lrow As Long

worksheets("Master").cells.clearcontents
for i = 1 to worksheets.count
   if worksheets(i).name <>"Master" then
       worksheets(i).rows("10:10").copy worksheets("Master").range("A10")
   end if
next i

For i = 1 To Worksheets.Count
    With Worksheets(i)
        If .Name Like "P*" Then
            lrow = .Range("B" & .Rows.Count).End(xlUp).Row
            .Range("B10:P" & lrow).Copy Worksheets("Master").Range("B" & Rows.Count).End(xlUp).Offset(1, 0)
        End If
    End With
Next i

End Sub