- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-10-21
|
¥»©«³Ì«á¥Ñ Andy2483 ©ó 2022-10-31 10:53 ½s¿è
¦^´_ 12# ã´£³¡ªL
'ÁÂÁ«e½ú
'³o©«¾Ç¨ì
'1.¸ê®Æ«¬ºA:ªø¾ã¼Æªº³Ì¤pÈ ¬O-2147483648
'2.ª¾¹D¤°»ò¬O¼Æ¦r·¸¦ì
'3.¤£¯à¥u¬Ý°ÝÃDªº¥¿±!t±ªº¤]n¦Ò¼{!²¦³º¥D¨¤¬O¼Æ¦r
'4.¨¾»~§P¬O«Ü«nªº¨Æ!
'5.«Ü¦hª¾ÃÑ»P¾Ç°Ý¬O½m²ß¤~¯àÅé·|ªº!
'6.¤Ñ§U¦Û§U¤H§U
½Ð«e½ú¦A«ü¾É!ÁÂÁÂ
Option Explicit
Sub TEST()
Dim Arr, V&, U1&, U2&, i&, j%, T$
'¡ô«Å§iÅܼÆ
Arr = Range([A1], [m65536].End(xlUp))
'¡ô¥OArr¬O°}¦C!ˤJ[A1]¨ìMÄæ³Ì«á¤@Ó¦³¤º®eÀx¦s®æ,ÂX®i¨ì¤è¥¿³Ì¤p°Ï°ìÀx¦s®æÈ
For i = 1 To UBound(Arr)
'¡ô³]¥~¶¶°j°é!±q1¨ìArr°}¦CÁa¦V³Ì«á¤@¦C¼Æ
V = -9 ^ 9
'¡ô¥OV¼Æ¦r¬O9ªº9¦¸¤ètÈ=(9 ^ 9)*(-1)= -387420489
'¬d¸ß¤FVBA ªº¸ê®Æ«¬ºA: V& ªø¾ã¼Æªº³Ì¤pÈ ¬O-2147483648 !
'¬°¤°»ò¤£¥Î¥¦·íVÈ?? ¦]¬°«á¤èµ{§Ç·|ÅýÅܼƷ¸¦ì(¤ñ -2147483648 §ó¤p)
'¦]¬°Vªºªì©lȬO0 ¦pªG¤@¶}©l¨S¦³µ¹V¤@ӲĤ@¨Ï¥ÎÈ
'«á¤èªºµ{§Ç·|»~§P[A1]=1 ®É³sÄò
For j = 1 To UBound(Arr, 2)
'¡ô³]¤º¶¶°j°é!±q1¨ìArr°}¦C¾î¦V³Ì«á¤@Äæ¼Æ
U1 = Arr(i, j)
'¡ô¥OU1¬OArr°}¦C¤º¥~°j°éªº¥D¨¤(¼Æ¦r)
U2 = U1
'¡ôU2 = U1¬O¬°¤F ®ø°£U2¦b«e¦¸°j°é¤¤´Ý¾l¼Æ¦r(U2ªì©lȬO0)
If j < UBound(Arr, 2) Then
'¡ô¦pªGj³o¤º°j°é¼Æ¤p©ó Arr°}¦C¾î¦V³Ì«á¤@Äæ¼Æ
U2 = Arr(i, j + 1)
'U2´NÅܤߦ¨¬° U1¥D¨¤¥kÃä®æªº¨ºÓÈ(¼Æ¦r)
End If
If U1 - V = 1 Or U2 - U1 = 1 Then
'¡ô¦pªG¥D¨¤U1 - V =1,¬On§PÂ_t¼ÆȪº³sÄò
'©Î ÅܤßU2ªº-¥D¨¤U1=1
T = T & "," & U1
'¡ô¥OT =T¦r¦ê³s±µ "," ²Å¸¹ ,¦A³s±µ¥D¨¤U1
V = U1
'¡ô¥OV¼Æ¦r¬O¥D¨¤U1È
End If
Next j
Arr(i, 1) = Mid(T, 2)
'¡ô¥O¥~°j°éArr°}¦Cªº²Ä¤@Äæ¨ú¤º°j°é T¦r¦ê¸Ìªº²Ä2Ó¦r¶}©l(§t¦Û¤v)ªº¥þ³¡¦r¦ê
'¡ôMid(T, 2)«á¾Ç¤µ¤Ñ¤~ª¾¹D¥i¥H³o¼Ë³¯z!¥H«e³£¥ÎMid(T, 2,99)
'¦]¬°²Ä¤@Ó¦r¬O "," ²Å¸¹
T = ""
'¡ô¥O²MªÅ T¦r¦ê
Next i
[O1].Resize(UBound(Arr)) = Arr
'¡ôArr°}¦C ±q[O1]¶}©l¶K¤J Arr°}¦CÁa¦V³Ì«á¤@¦C¼Æ,¥u¶K¤J1Äæ¦ì¸ê®Æ
'¦P[O1].Resize(UBound(Arr), 1) = Arr,1¥i¥H¬Ù²¤
End Sub
°õ¦æ«e:
°õ¦æµ²ªG:
|
|