Sub DATA()
Sheet2.[A265536].ClearContents
Y = Sheet2.[A65536].End(xlUp).Row + 1
X = Sheet1.[A65536].End(xlUp).Row
For M = 2 To X
If Sheet1.Cells(M, 21) - 25 >= 0 And Sheet1.Cells(M, 21) - 40 <= 0 Then
Sheet2.Cells(Y, 1) = Sheet1.Cells(M, 1)
Sheet2.Cells(Y, 2) = Sheet1.Cells(M, 2)
Sheet2.Cells(Y, 3) = Sheet1.Cells(M, 5)
Sheet2.Cells(Y, 4) = Sheet1.Cells(M, 21)
Y = Y + 1
End If
Next
Sheet2.Select
Range("A1").Select
End Sub作者: united7878 時間: 2014-11-28 03:23