ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¦p¦ó±N¦h­ÓIF¤ÆÁc¬°Â²¡H

[µo°Ý] ¦p¦ó±N¦h­ÓIF¤ÆÁc¬°Â²¡H

  1. If [B5] = 1 Then Look1
  2.     If [B5] = 2 Then Look2
  3.     If [B5] = 3 Then Look3
  4.     If [B5] = 4 Then Look4
  5.     If [B5] = 5 Then Look5
  6.     If [B5] = 6 Then Look6
  7.     If [B5] = 7 Then Look7
  8.     If [B5] = 8 Then Look8
  9.     If [B5] = 9 Then Look9
  10.     If [B5] = 10 Then Look10
  11.     If [B5] = 11 Then Look11
  12.     If [B5] = 12 Then Look12
  13.     If [B5] = 13 Then Look13
  14.     If [B5] = 14 Then Look14
  15.     If [B5] = 15 Then Look15
  16.     If [B5] = 16 Then Look16
½Æ»s¥N½X
¦A¦¸·PÁÂ!

¦^´_ 1# av8d

³o­Ó²Å¦X»Ý¨D?
  1. Sub chooseVar()
  2.     look1 = 1
  3.     look2 = 2
  4.     look3 = 3
  5.     aa = Choose([B5], look1, look2, look3)
  6.     bb = Switch([B5] = 1, look1, [B5] = 2, look2, [B5] = 3, look3)
  7. End Sub
½Æ»s¥N½X

TOP

¦^´_ 1# av8d
'½Ð±N¤U¦C©ñ¦bSheet1 , ¤£­n©ñ Module1
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim I, j As Integer, Rng As Range
    If Not Intersect(Target, [B5]) Is Nothing Then
        If Application.IsNumber([B5]) Then
            Application.Run "Book1!look" & [B5] & ""
        End If
    End If
End Sub

'½Ð±N¤U¦C©ñ¦b Module1, ¤£­n©ñ Sheet1
Sub look1()
   MsgBox "look1"
End Sub
Sub look2()
   MsgBox "look2"
End Sub
Sub look3()
   MsgBox "look3"
End Sub
Sub look4()
   MsgBox "look4"
End Sub
Sub look5()
   MsgBox "look5"
End Sub

'µM«á¸Õ Sheet1 ªº [B5]

TOP

¥»©«³Ì«á¥Ñ Scott090 ©ó 2014-5-13 13:33 ½s¿è

¦^´_ 1# av8d


    ©ÎªÌ¡G
  1. On [B5] GoTo look1, look2, look3
  2.     On [B5] GoSub look1, look2, look3
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ÁÀ¨¥¹³¤@¦·²±¶}ªºÂAªá¡A¥~ªí¬üÄR¡A¥Í©Rµu¼È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD