- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 16
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-11-14
|
¥»©«³Ì«á¥Ñ luhpro ©ó 2021-1-6 23:57 ½s¿è
If Brr(R, 1) T Then T = Brr(R, 1): S = T
If Brr(R, 1) <> T Then T = Brr(R, 1): S = T
³o¤@¦æ§ÚŪ¤£À´
´ú¸Õ¦pªG§â¥¦²¾°£¡A´N¤£·|¥X²{"³sÄò¤p" ªº¼Ð°O¸ò°T®§
Brr(R, 1) <> T ( T¬O±q¦ó¦Ó¨Ó?
y54161212 µoªí©ó 2021-1-6 14:43
³oºØ¤ñ¸û²³æªº·§©À§Ú´N¥N³Ò¤@¤U:
µ{¦¡¶}ÀY´N©w¸q¤F T% ªí¥Ü¥¦¬OÓ¾ã¼Æ,
¤@¶}©l¨S¯S§O¥h½áȮɹw³]ȬO0,
¤]´N¬O»¡²Ä1¦¸¬O¸ò0¤ñ¸û.
Brr(R, 1) = IIf(Arr(R, 1) > CL, 1, -1) ' ¤ñ¸û«á«ü©w¥[´î¼Æ
S = S + Brr(R, 1) ' ¤j©ó®É + 1, ¤p©ó®É - 1, ¥[¨ì +8 ©Î -8 ®É´N¬O³sÄò8¦¸ ¤j©ó ©Î ¤p©ó ¤F
If S = N Then ³sÄò¤j = True: S = S - 1: Brr(R, 2) = 1 ' ³o¸Ì¬O "¤j©ó" °Ï S=8«á S=S-1 ´NÅܦ^ 7, ¤U¦¸¦A¥[1´N¤S=8 ¥i¦A¦¸Ä²µo¥»¦æªº±ø¥ó
If S = -N Then ³sÄò¤p = True: S = S + 1: Brr(R, 3) = 1 ' "¤p©ó" °Ï, ì²z¦P¤W.
If Brr(R, 1) <> T Then T = Brr(R, 1): S = T ' ¨ä¹ê´N¬O«O¦s¥»¦¸ªºÈ¥H³Æ¤U¤@¦¸¤ñ¸û¬O¤£¬OȤ£¦P¤F¥Î.
³o¸Ì¶¶«K¤]´£¨Ñ¤@¤U§Ú·í®Éקï«áªº¸Ñªk, (¥H3#°µ¥Àª©×§ï)
¹Á¸Õ§ï¦¨Åã¥Ü 0 ¦Ó¤£¬O -1 §@¹ê²{.- Sub §PÂ_«~½è²§±`()
- Const N = 7 '³]©w³sÄò¦¸¼Æ
- Dim Rn&, R%, S%, T%, CL!
- Dim ³sÄò¤j As Boolean, ³sÄò¤p As Boolean
- Rn = Cells(Rows.Count, 1).End(xlUp).Row - 2
- If Rn < 1 Then Exit Sub
- CL = [C1]
- With [C3].Resize(Rn, 3)
- Arr = .Offset(, -2).Resize(, 5).Value
- .ClearContents
- End With
- For R = 1 To Rn
- Arr(R, 3) = IIf(Arr(R, 1) > CL, 1, 0)
- S = S + (Arr(R, 3) = 0) * 2 + 1
- If S = N Then S = S - 1: ³sÄò¤j = True: Arr(R, 4) = 1
- If S = -N Then S = S + 1: ³sÄò¤p = True: Arr(R, 5) = 1
- If Arr(R, 3) <> T Then T = Arr(R, 3): S = T
- Next R
- [A3].Resize(Rn, 5) = Arr
- If ³sÄò¤j Then MsgBox "³sÄò7ÂI¦b¤¤¤ß½u¦P°¼(¤j©ó)"
- If ³sÄò¤p Then MsgBox "³sÄò7ÂI¦b¤¤¤ß½u¦P°¼(¤p©ó)"
- End Sub
½Æ»s¥N½X |
|