I use OR to form a multiple condition IF ELSE statement on VBA, it's not working

前端 未结 2 1108
一向
一向 2020-11-28 16:22
Dim cat As Integer
For cat = 2 To last
    Range(\"AB\" & cat).Select

    If Selection.Value = \" \" Then
        ActiveCell.Offset(0, -2).Value = \"-\"
                


        
2条回答
  •  情歌与酒
    2020-11-28 16:38

    I think you need to express equality in each condition. In other words, instead of this:

    (Selection.Value = "hold to console" Or
     "Hold to console" Or
     "Allocated 14/12 and ship next day") Then
    

    you need to use this:

    (Selection.Value = "hold to console" Or
     Selection.Value = "Hold to console" Or
     Selection.Value = "Allocated 14/12 and ship next day") Then
    

提交回复
热议问题