发布网友 发布时间:2022-04-23 21:47
共1个回答
热心网友 时间:2022-07-14 15:30
Private Sub CommandButton1_Click()
Dim i,s,arr
for i=2 to 6
arr=split(Cells(i,"D"),"-")
If Cells(i,"B") < arr(0) Or Cells(i,"B") > arr(1) Then
Cells(i,"B").Interior.ColorIndex = 3
s = s & Cells(i,"A") & vbcrlf
End If
next i
if s<>"" then MsgBox s & "超过合理范围" else msgbox "全部符合"
End Sub