case语句中的multipe范围 [英] multipe ranges in case statement
问题描述
我希望在下面的某些单元格中输入值时可以看到一些形状是我使用的代码,在这个单元格I5输入时,形状将是可见的,它不会检查其他单元格,任何人都可以引导我这个
I want t make some shapes visible when value is entered in some cells below is the code which I used, in this when cell I5 is entered shapes will be visible its not checking other cells , can anyone guide me on this
选择案例范围("I5,D5,D6,D7,I6,I7,I4")。
Case Is =""
ActiveSheet.Shapes(" shape1")。Visible = False
ActiveSheet.Shapes(" shape2")。Visible = False
Case Else
ActiveSheet.Shapes(" shape1")。Visible = True
ActiveSheet.Shapes( " shape2")。可见=真
Select Case Range("I5, D5, D6, D7,I6,I7,I4").Value
Case Is = ""
ActiveSheet.Shapes("shape1").Visible = False
ActiveSheet.Shapes("shape2").Visible = False
Case Else
ActiveSheet.Shapes("shape1").Visible = True
ActiveSheet.Shapes("shape2").Visible = True
结束选择
推荐答案
选择案例Application.Counta(范围("I5,D5,D6,D7,I6,I7,I4") )))
案例为0
Select Case Application.Counta(Range("I5, D5, D6, D7,I6,I7,I4"))
Case Is 0
这篇关于case语句中的multipe范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!