- ©«¤l
- 51
- ¥DÃD
- 17
- ºëµØ
- 0
- ¿n¤À
- 200
- ÂI¦W
- 0
- §@·~¨t²Î
- winxp
- ³nÅ骩¥»
- officexp
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-7-31
- ³Ì«áµn¿ý
- 2018-9-19
|
¥»©«³Ì«á¥Ñ mnsmrtl ©ó 2018-9-3 15:38 ½s¿è
- Sub Ac§ìĵ¥Ü()
- Call GetAlarm(1)
- End Sub
- Sub GetAlarm(Nd)
- Dim xRow%, xCode, xDate As Range, i, j, writeIn As Range
- Call AÃö³¬
- xRow = Sheets("°ò¥»").[A1].End(xlDown).Row
- For i = 2 To xRow
- With Sheets("°ò¥»")
- xCode = .Cells(i, "A")
- Set writeIn = .Range(.Cells(i, "C"), .Cells(i, "T")) '«¬ºA°ª§C ¼g¤J¸ê®Æ½d³ò
- End With
- Set xDate = Sheets("¦¬").Cells(1, 3).Offset(0, Nd - 1) '®Ú¾Ú°Ñ¼Æקï°_©l¤Ñ¼Æ
- Call Pattern(writeIn, xCode, xDate)
- Next i
- Call A¶}±Ò
- End Sub
- Function grabData(Sht$, xCode, xDate As Range) '±q¸ê®Æ®w§ì¨ú¼Æ¾Ú
- Dim matC, matD
- With Sheets(Sht)
- matC = WorksheetFunction.Match(xCode, .Columns(1), 0)
- matD = WorksheetFunction.Match(xDate, .Rows(1), 0)
- Set grabData = .Cells(matC, matD)
- End With
- End Function
- Function fbdate(Rng As Range) '«öÀx¦s®æ§ä¡u¤é´Á¡v
- Set fbdate = Sheets(Rng.Worksheet.Name).Cells(1, Rng.Column)
- End Function
- Sub Pattern(Rng As Range, xCode, xDate As Range)
- Dim H As Range, L As Range, C As Range, rh As Range, rl As Range
- Dim Tf1 As Boolean, Tf2 As Boolean
- Dim i, j, k, th, tl, sw
- Rng.ClearContents
- i = 0: j = 0: k = 0
- th = 0: tl = 0: sw = 0
- Do While i < 8 '¨ú6ÓÂI
- Set H = grabData("°ª", xCode, xDate).Offset(0, j)
- Set L = grabData("§C", xCode, xDate).Offset(0, j)
- Set C = grabData("¦¬", xCode, xDate).Offset(0, j)
- If j > 300 Then Exit Do '¨î¸ê®Æ®w½d³ò
- If C <> "" Then
- k = k + 1 'p¼Æ
- If k = 1 Then GoSub RefreshHL
- Tf1 = sw >= 0 And C < tl * 0.9
- Tf2 = sw <= 0 And C > th * 1.1
- If Tf1 Or Tf2 Then
- GoSub MoveAndSwitch
- GoSub WriteDataIn
- GoSub RefreshHL
- Else
- Set rh = IIf(H > rh, H, rh)
- Set rl = IIf(L < rl, L, rl)
- th = IIf(H < th, H, th)
- tl = IIf(L > tl, L, tl)
- GoSub WriteDataIn
- End If
- End If
- Debug.Print H.Column
- j = j + 1
- Loop
- Exit Sub
- MoveAndSwitch:
- i = i + 1
- sw = IIf(sw >= 0, -1, 1)
- Return
- WriteDataIn:
- If i < 7 And i > 0 Then
- Rng(i) = IIf(sw = 1, rh, rl)
- Rng(i + 6) = fbdate(IIf(sw = 1, rh, rl))
- Rng(i + 12) = k
- End If
- Return
- RefreshHL:
- Set rh = H
- Set rl = L
- th = H
- tl = L
- Return
- End Sub
½Æ»s¥N½X ¦]¬°ÀÉ®×À£ÁY«á¤]¬O¶W¹L1MB¡A©Ò¥H§Ú§â¦³¥Î¨ìªºµ{¦¡½X¶°¤¤©ñ¤@°_¦A¶K¤@¦¸
¹ï©óÅܼÆJ¡A¦b¨ä¥Lµ{§Ç¨S¦³°µ¤°»ò°Ê§@
Àɮפº¡A¬O¦UªÑ²¼ªº¨C¤é¶}½L¥|»ù¤Î¦¨¥æ¶q
¦p¹Ï
ºÊ¬Ý¦¡ªº³¡¤À¡A§Ún¦A¬d¤@¤U¸ê®Æ¡A¬Ý«ç»ò¥Î¡KÁÂÁ¼ӤW«üÂI
¤W¶Ç¨ìMEGAªÅ¶¡¤F¡A¤j¬ù15M¡Aºô§}¦p¤U
https://mega.nz/#!uTZkGI4K!XtnUzYtIyzsHBFPNF4hGrcroUtzdO8UthkdFSorPVxk |
|