一个关于select case 的问题
select case theCasescase 1,2,3,4,5
end select
上面这段是否等价于下面这段
for i=1 to 5
select case theCases
case i
do something
end select
next
Dim y As Integer Dim p As Integer y = 0 p = 0 Dim a(8) As Integer a(1) = 1 a(2) = 3 a(3) = 22 a(4) = 6 a(5) = 10 a(7) = 222 a(6) = 62 a(8) = 102 For i = 1 To 8 Select Case a(i) y = y + 1 End Select Next MsgBox y For j = 1 To 8 Select Case Sheet1.Cells(1, j) Case 1, 3, 22, 6, 10, 222, 62, 102 p = p + 1 End Select Next MsgBox p的确是不一样,有什么办法使得select case 可以使用不定数目的条件呢。