Use of If statement with multiple conditions

前端 未结 6 2028
挽巷
挽巷 2021-01-15 23:54

I have written the following code which is basically supposed colour some boxes accordingly. Whenever i run this code, it runs the first case i.e. even when some other case

6条回答
  •  终归单人心
    2021-01-16 00:18

    Ok, So the problem here is the "If statement".

    The correct way of defining the 'OR' is as so

    If Sheet2.Range("B6").Value = 1 Or Sheet2.Range("B6").Value = 2 Or Sheet2.Range("B6").Value = 3 Then
    

提交回复
热议问题