Sheet2.[A4:L65536].ClearContents
Y1 = Sheet2.[A65536].End(xlUp).Row
For M = 4 To X
If Sheet1.Cells(M, 4) = "張" Then
Sheet2.Cells(Y1 + 1, 1).Resize(, 12).Value = Sheet1.Cells(M, 1).Resize(, 12).Value
Y1 = Y1 + 1
End If
Next
Sheet3.[A4:L65536].ClearContents
Y2 = Sheet3.[A65536].End(xlUp).Row
For M = 4 To X
If Sheet1.Cells(M, 4) = "陳" Then
Sheet3.Cells(Y2 + 1, 1).Resize(, 12).Value = Sheet1.Cells(M, 1).Resize(, 12).Value
Y2 = Y2 + 1
End If
Next
Sheet4.[A4:L65536].ClearContents
Y3 = Sheet4.[A65536].End(xlUp).Row
For M = 4 To X
If Sheet1.Cells(M, 4) = "揚" Then
Sheet4.Cells(Y3 + 1, 1).Resize(, 12).Value = Sheet1.Cells(M, 1).Resize(, 12).Value
Y3 = Y3 + 1
End If
Next
Sheet5.[A4:L65536].ClearContents
Y4 = Sheet5.[A65536].End(xlUp).Row
For M = 4 To X
If Sheet1.Cells(M, 4) = "林" Then
Sheet5.Cells(Y4 + 1, 1).Resize(, 12).Value = Sheet1.Cells(M, 1).Resize(, 12).Value
Y4 = Y4 + 1
End If
Next