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

VBA¯à±q°õ¦æ¤@­Ó¥¨¶°¤¤¸õ¨ì¥t¤@­Ó¥¨¶°¶Ü?

VBA¯à±q°õ¦æ¤@­Ó¥¨¶°¤¤¸õ¨ì¥t¤@­Ó¥¨¶°¶Ü?

¦p¤U¨Òµ{¦¡½X¡A§Ú§Æ±æ·í°õ¦ætest1®Éº¡¨¬¬Y±ø¥ó´N¯à¸õ¨ìtest2°õ¦æ¡A¤£¹L¥H¤Uµ{¦¡½X°õ¦æ®É·|¥X²{BR¥¼©w¸q¡A½Ð¦U¦ì°ª¤âÀ°¦£¤@¤U
­n«ç»ò¼g¤~¯à¦bº¡¨¬test1ªº±ø¥ó®É¸õ¨ìtest2«ü©wªºµ{§ÇÄ~Äò°õ¦æ¡H·PÁ¡I
  1. Sub test1()
  2. If Range("a1").Value = 2 Then GoTo BR
  3. End Sub

  4. Sub test2()

  5. BR:
  6.     Range("a2").Value = 3
  7.     Range("a3").Value = 4

  8. End Sub
½Æ»s¥N½X

  1. Sub test1()

  2. If Range("a1").Value = 2 Then
  3.     Call test2
  4. End If

  5. End Sub

  6. Sub test2()
  7.     Range("a2").Value = 3
  8.      Range("a3").Value = 4
  9. End Sub
½Æ»s¥N½X
¦^´_ 1# smart3135

TOP

¦^´_ 2# twosix
·PÁ¦^ÂСA¤£¹L¥i¯à¬O§Úªí¹Fªº¤£°÷²M·¡¡A§Ú§Æ±æªºµ²ªG¬O·ítest1±ø¥ó¦¨¥ß®Éª½±µ¸õ¨ìtest2¬Yµ{§Ç¡A¦Ó¤£¬Otest2¾ã­Óµ{§Ç¡A¦pµ{¦¡½X»¡©ú
  1. Sub test1()
  2. If Range("a1").Value = 2 Then GoTo BR  '·í¦¹±ø¥ó¦¨¥ß®É§Æ±æ¯à¸õ¨ìtest2ªºBR°õ¦æ±µ¤U¨Óªºµ{§Ç
  3. If Range("a2").Value = 3 Then GoTo MN  '·í¦¹±ø¥ó¦¨¥ß®É§Æ±æ¯à¸õ¨ìtest2ªºMN°õ¦æ±µ¤U¨Óªºµ{§Ç

  4. End Sub

  5. Sub test2()

  6. Range("a:a").Height = 15
  7. Range("b:b").Width = 16

  8. BR:
  9.     Range("a2").Value = 3
  10. MN:
  11.     Range("a3").Value = 4

  12. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¦¨¥\¬OÀuÂIªºµo´§¡A¥¢±Ñ¬O¯ÊÂIªº²Ö¿n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD