|
Sub tiqu()
Dim x, m, n, j
Dim arr, brr(1 To 30, 1 To 8)
Dim starday, endday, qd
starday = Sheets("抗压强度评定").[o3]
endday = Sheets("抗压强度评定").[o4]
qd = Sheets("抗压强度评定").[p4]
arr = Sheets("试块强度输入").[a1].CurrentRegion
For x = 2 To UBound(arr)
If CDate(arr(x, 2)) >= CDate(starday) And CDate(arr(x, 2)) <= CDate(endday) Then
If arr(x, 11) = qd Then
If arr(x, 8) <> "" Then
n = n + 1
If n Mod 8 = 0 Then
j = (n \ 8)
m = 8
Else
j = (n \ 8) + 1
m = n Mod 8
End If
brr(j, m) = arr(x, 8)
End If
End If
End If
Next
Sheets("抗压强度评定").[e5:l35].ClearContents
If n > 240 Then
MsgBox "提取到符合的数值共:" & n & "个¸超出限定数量240个!"
Exit Sub
Else
Sheets("抗压强度评定").[e5].Resize(j, 8) = brr
End If
End Sub
|
|