我有一段愚蠢的代码来测试变量是否是某个字符串:
If Target.Cell.Value = "1M" or Target.Cell.Value = "1N" or Target.Cell.Value = "1O" Then
...
End If
有没有办法压缩if语句 - 即与列表或类似的东西进行比较?
谢谢 - KC
答案 0 :(得分:3)
Select Case Target.Cell.Value
Case "1M","1N","10"
...
end select