- ©«¤l
- 12
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 54
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-6-13
- ³Ì«áµn¿ý
- 2020-9-1
|
¦^´_ 2# GBKEE
¤£¦n·N«ä,§Ú¥J²Ó¤@¬Ý,³oµ{¦¡½X,¬O§â¨C¶g¤ªº¶}§C¦¬°ª¨q¥X¨Ó,¨º§Ú·Q§â¶}½L»ù³]¦b¶g¤@,³Ì°ª³Ì§C¬O³o¦b¶g©Ò¥X²{ªº¼ÆÈ,¦¬½L·íµM¶g¤³Ì«áªº»ù®æ,§Ú¦³¬Ý¨ì¹ï©¤¼gªºµ{¦¡½X,¦ý§Ú¤£ª¾¹Dn±q¦Ó§ï°_,½Ðª©¥D¬Ý¬Ý
Sub bwwweek()
¡¥«Ø¥ß·sªº¤u§@ªí, ¦s©ñ©P数Õu
ActiveWorkbook.Sheets.Add after:=Worksheets(1)
Worksheets(1).Activate
¡¥§â²Ä¤@¦æ数Õu¦s¨ì变¶q¡Ahand为¦æ号¡Ah为³Ì°ª¡Al为³Ì§C¡Ac为¦¬盘¡Ad为¤é´Á¡Avol为¦¨¥æªÑ数¡Aamt为¦¨¥æª÷额
Dim hand As Integer, h As Double, l As Double, _
c As Double, d As Date, o As Double, _
vol As Long, amt As Long
hand = 1
d = Worksheets(1).Cells(hand, 1).Value
¡¥¥æ©ö²Ä¤@¤ÑÖÃ开¬P´Á¤¦³¤L¤Ñ,n5计数¾¹¡Afri储¦s¬P´Á¤ªº¤é´Á
Dim n5 As Integer, md5 As Date
For n5 = 0 To 4
fri = d + n5
If Weekday(fri) ¡V 1 = 5 Then
Exit For
End If
Next n5
¡¥²Ä¤@©Pªº¦æ数,row1为¥»©P²Ä¤@¥æ©ö¤é¦æ数¡Arow5为¥»©P³Ì¦Z¥æ©ö¤é¦æ数, frim暂储¦s¤@©P内¥æ©ö¤éªº数Õu, ¥Î¤_©M这©Pfri¤é´Á¤ñ较,¤j¤_fri§Y计ºâ¥»©P³Ì¦Z¥æ©ö¤é¦æ数
Dim row1 As Integer, row5 As Integer, frim As Date
row1 = 1
Dim n As Integer
For n = 1 To 6
If frim > fri Then
row5 = n ¡V 1
Exit For
End If
frim = Worksheets(1).Cells((hand + n), 1).Value
Next n
¡¥§â总¦@ªÑ²¼¤éK线ì©l数Õuªº¦æ数储¦s¦brng变¶q
Dim rng As Integer
rng = Range(¡§A65536¡²).End(xlUp).Row
Dim whand As Integer, wdate As Date
whand = 1
¡¥==========================================================
While row1 <= rng
¡¥¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X
If frim >= fri Or frim = 0 Then
¡¥§â¤@©P开盘,¦¬盘,¶qµ¥¦s¤J变¶q, ¥Î¤_¤U±写¤J©Pªº·s¤u§@ªí
wopen = Worksheets(1).Cells(row1, 2).Value
whigh = Application.WorksheetFunction.Max(Range(Cells(row1, 3), Cells(row5, 3)))
wlow = Application.WorksheetFunction.Min(Range(Cells(row1, 4), Cells(row5, 4)))
wclose = Worksheets(1).Cells(row5, 5).Value
wdate = Worksheets(1).Cells(row1, 1).Value
hand = row5 + 1
Worksheets(2).Cells(whand, 1).Value = wdate
Worksheets(2).Cells(whand, 2).Value = wopen
Worksheets(2).Cells(whand, 3).Value = whigh
Worksheets(2).Cells(whand, 4).Value = wlow
Worksheets(2).Cells(whand, 5).Value = wclose
whand = whand + 1
End If
¡¥¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X-
If hand <= rng And frim <> 0 Then
frim = Worksheets(1).Cells(hand, 1).Value
¡¥- - - - - - -
For n5 = 0 To 4
fri = frim + n5
If Weekday(fri) ¡V 1 = 5 Then
Exit For
End If
Next n5
¡¥- - - - - - -
row1 = row5 + 1
¡¥///////////////////////////////////////////////////
For n = 1 To 6
If frim > fri Or frim = 0 Then
row5 = row5 + n ¡V 1
Exit For
End If
frim = Worksheets(1).Cells((hand + n), 1).Value
Next n
¡¥//////////////////////////////////////////////////
Else
row1 = row5 + 1
End If
¡¥¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡V
Wend
¡¥===================================================
End Sub |
|