目前就算上面四項未達成,只要有一個or就被更改數值了
希望:
Or InStr(arr(I, 6), "可") > 0 _
Or InStr(arr(I, 6), "冬") > 0 _
Or InStr(arr(I, 6), "麥") > 0 _
以上任一達成條件的前提下必須以下四項皆達成條件才算數
If InStr(arr(I, 8), "保") = 0 _
And InStr(arr(I, 10), "不清除") = 0 _
And InStr("飲品", arr(I, 5)) > 0 _
And InStr("飲品", arr(I, 5)) > 0 _
With Range([A1], Cells(Rows.Count, "J").End(xlUp))
arr = .Value
For I = 1 To Cells(ActiveSheet.Rows.Count, 1).End(xlUp).Row '.Count
If InStr(arr(I, 8), "保") = 0 _
And InStr(arr(I, 10), "不清除") = 0 _
And InStr("飲品", arr(I, 5)) > 0 _
And InStr("飲品", arr(I, 5)) > 0 _
Or InStr(arr(I, 6), "可") > 0 _
Or InStr(arr(I, 6), "冬") > 0 _
Or InStr(arr(I, 6), "麥") > 0 _
Then arr(I, 7) = 0
Next I
.Value = arr
End With
複製代碼
作者: 准提部林 時間: 2016-11-22 10:19
if InStr(arr(I, 6), "可") Or InStr(arr(I, 6), "冬") Or InStr(arr(I, 6), "麥") then
If InStr(arr(I, 8), "保") = 0 And InStr(arr(I, 10), "不清除") = 0 And InStr("飲品", arr(I, 5)) then
~~做些什麼~~
end if
end if作者: starry1314 時間: 2016-11-22 10:35