【发布时间】:2017-08-05 20:09:33
【问题描述】:
Dim cat As Integer
For cat = 2 To last
Range("AB" & cat).Select
If Selection.Value = " " Then
ActiveCell.Offset(0, -2).Value = "-"
ActiveCell.Offset(0, -1).Value = "-"
ElseIf Selection.Value = "Address in local wording" Then
ActiveCell.Offset(0, -2).Value = "Customer"
ActiveCell.Offset(0, -1).Value = "Incomplete information or awaiting more info from customer"
ElseIf (Selection.Value = "hold to console" Or "Hold to console" Or "Allocated 14/12 and ship next day") Then
ActiveCell.Offset(0, -2).Value = "Depot"
ActiveCell.Offset(0, -1).Value = "Allotment delay"
ElseIf (Selection.Value = "Backorder" Or "backorder" Or "Back order" Or "back order") Then
ActiveCell.Offset(0, -2).Value = "Inventory"
ActiveCell.Offset(0, -1).Value = "Material not available causing backorder"
End If
Next cat
我得到的结果是当 Selection.Value 为空时,"-" , "-"
其余的都只显示 "Depot" 、 "Allotment delay"。
这段代码有什么问题?
【问题讨论】:
标签: vba if-statement multiple-conditions