gpt4 book ai didi

excel - 一次多个字符串比较

转载 作者:行者123 更新时间:2023-12-04 21:08:02 25 4
gpt4 key购买 nike

我有一段愚蠢的代码可以测试变量是否是某个字符串:

If Target.Cell.Value = "1M" or Target.Cell.Value = "1N" or Target.Cell.Value = "1O" Then
...
End If

有没有办法压缩该 If 语句 - 即与列表或类似的东西进行比较?

最佳答案

Select Case Target.Cell.Value
Case "1M","1N","10"
...
end select

关于excel - 一次多个字符串比较,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47513298/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com