VBA select case 练习
Sub demo() ' select case 练习 Dim card As String Dim i As Integer For i = 1 To 14 card = Range("a" & i) Select Case card Case "j" Range("b" & i) = "一等奖" Case "q" Range("b" & i) = "二等奖" Case "k" Range("b" & i) = "三等奖" Case "a" Range("b" & i) = "四等奖" Case Else Range("b" & i) = "谢谢参与" End Select Next End Sub '效果 1 谢谢参与 2 谢谢参与 3 谢谢参与 4 谢谢参与 5 谢谢参与 6 谢谢参与 7 谢谢参与 8 谢谢参与 9 谢谢参与 10 谢谢参与 j 一等奖 q 二等奖 k 三等奖 a 四等奖