³sÄò & ¤£³sÄò ¤§°}¦C³B²z¤è¦¡ex:1~3,5,7,9~11
- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 174
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2025-7-18
               
|
- Sub ex()
- Dim Ay()
- ar = Array(1, 2, 3, 5, 7, 9, 10, 11, 13, 14, 15) '¤£³sÄò°}¦C
- For i = 0 To UBound(ar) - 1 ''¤£³B²z³Ì«á¤¸¯À
- j = i
- x = ar(j)
- Do Until ar(j) + 1 <> ar(j + 1)
- j = j + 1
- If j = UBound(ar) Then Exit Do
- Loop
- y = ar(j)
- i = j
- ReDim Preserve Ay(s)
- Ay(s) = IIf(x = y, x, x & "~" & y)
- s = s + 1
- Next
- If j = UBound(ar) - 1 Then '³B²z³Ì«á¤¸¯À
- ReDim Preserve Ay(s)
- Ay(s) = ar(UBound(ar))
- End If
- MsgBox Join(Ay, ",")
- End Sub
½Æ»s¥N½X ¦^´_ 7# PKKO |
|
¾Ç®üµL²P_¤£®¢¤U°Ý
|
|
|
|
|