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

[µo°Ý] for next

[µo°Ý] for next

For k = 70 To 4
next
§Ú·Q¥[­Ó±ø¥óÅܦ¨ k= 4 to 70¤]´N¬O¤U­±¤G¿ï¤@
For k = 70 To 4
for  k= 4 to 70
----------------
For k = 70 To 4 step -1
next
for  k= 4 to 70
next
¦]¬° §Úªº for next  ¸Ì­±ÁÙ¦³«Ü¦hµ{¦¡½X
¦pªG§ï¦¨¤W­±·|¤ñ¸û½ÆÂø¡A¤£®e©ö¬Ý
¤£ª¾¦³µL¸û²³æªº§ïªk¡H¡H

¤U­±ªº§ïªk
¿ù»~°T®§ ¦³else Óý¨S¦³ IF
If Range("j16") = 1 Then
For k = 70 To 4
Else
For k = 4 To 70
End If
next

  1. If Range("j16") = 1 Then
  2. For k = 70 To 4
  3. µ{¦¡½X
  4. next k
  5. Else
  6. For k = 4 To 70
  7. µ{¦¡½X
  8. next k
  9. End If
½Æ»s¥N½X
½Ð°Ñ¦Ò¬Ý¬Ý¡I
§Ú¬O´µ¦h

TOP

¦^´_ 1# t8899

¤]¥i¥H§ï¥Î select case
  1. Dim Number
  2. Number = 8    ' ³]©wÅܼƪì­È¡C
  3. Select Case Number    ' §PÂ_ Number ªº­È¡C
  4. Case 1 To 5    ' Number ªº­È¦b 1 ¨ì 5 ¤§¶¡¡A¬O«D±Æ¥¦©Êªº¡C
  5.     Debug.Print "Between 1 and 5"
  6. ' ¤U¤@­Ó Case ¤l¥y¬O¥»½d¨Ò¤¤°ß¤@§PÂ_­È¬° True ªº¤l¥y¡C
  7. Case 6, 7, 8    ' Number ªº­È¦b 6 ¨ì 8 ¤§¶¡¡C
  8.     Debug.Print "Between 6 and 8"
  9. Case 9 To 10    ' Number ªº­È¬° 9 ©Î 10¡C
  10. Debug.Print "Greater than 8"
  11. Case Else    ' ¨ä¥¦¼Æ­È¡C
  12.     Debug.Print "Not between 1 and 10"
  13. End Select
½Æ»s¥N½X
§Ú¬O´µ¦h

TOP

r1 = 4: r2 = 70: p = 1
If Range("j16") = 1 Then r1 = 70: r2 = 4: p = -1
For k = r1 To r2 Step p
    N = N + p
Next k

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2021-6-8 13:50 ½s¿è

¦^´_ 1# t8899


For k = 70 To 4 step -1
next
for  k= 4 to 70
next
¦]¬° §Úªº for next  ¸Ì­±ÁÙ¦³«Ü¦hµ{¦¡½X
¦pªG§ï¦¨¤W­±·|¤ñ¸û½ÆÂø¡A¤£®e©ö¬Ý
¤£ª¾¦³µL¸û²³æªº§ïªk¡H¡H

¤]¥i¥H¥Î¸m´«Åܼƪº¤è¦¡¡A§â°j°é¤ºªºk³£§ïk1
¤£¹L§PÂ_¦b°j°é¤º¡A®Ä²v¸û®t¡A¥u¬O´£¨Ñ¥t¤@­Ó¼gªkÅý¤j®a°Ñ¦Ò¦Ó¤w


for  k= 4 to 70
If ±ø¥ó then k1=74-k else k1=k
Cells(k1,5)=""  '½d¨Ò
¨ä¥Lµ{¦¡½X
next
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

        ÀR«ä¦Û¦b : ¦³´¼¼z¤~¯à¤À¿ëµ½´c¨¸¥¿¡F¦³Á¾µê¤~¯à«Ø¥ß¬üº¡¤H¥Í¡C
ªð¦^¦Cªí ¤W¤@¥DÃD