Home > database >  Ask ace to the VBA code into pb, grateful
Ask ace to the VBA code into pb, grateful

Time:10-22

Sub tongda letter took a stock data ()
'On Error GoTo EH
Dim (Bs) As Byte
Dim arr ()
The Open ThisWorkbook. Path & amp; "\ SZ399300 day" For Binary As # 1 'can point to access the letter under the install directory "/Vipdoc/sh/lday" or "\ Vipdoc \ sz \ lday" "XXXXXXXX. Day" file
ReDim Bs (1 To LOF (1)) 'To save data To byte, starting from 1, each number 8 bytes, low before, and high in the
The Get # 1, and Bs
Close # 1
ReDim arr (1 To UBound (Bs)/4)
For I=1 To UBound (Bs)/4
Arr (I)=Bs ((I - 1) * 4 + 4) * 16 ^ 6 + Bs ((I - 1) * 4 + 3) * 16 ^ 4 + Bs ((I - 1) * 4 + 2) * 16 ^ 2 + Bs ((I - 1) * 4 + 1)
A=Int (I - 1)/(8) + 2
B=I Mod 8
If b=0 Then b=8
Cells (a, b)=arr (I)

Next I
[a1: h1]=Split (" date, opening price (points), the highest (points), the lowest price (points), close (points), volume (points), volume, and unknown ", ", ")
End Sub

CodePudding user response:

The
refer to the original poster shennongjia response:
Sub from tongda letter a stock data ()
'On Error GoTo EH
Dim (Bs) As Byte
Dim arr ()
The Open ThisWorkbook. Path & amp; "\ SZ399300 day" For Binary As # 1 'can point to access the letter under the install directory "/Vipdoc/sh/lday" or "\ Vipdoc \ sz \ lday" "XXXXXXXX. Day" file
ReDim Bs (1 To LOF (1)) 'To save data To byte, starting from 1, each number 8 bytes, low before, and high in the
The Get # 1, and Bs
Close # 1
ReDim arr (1 To UBound (Bs)/4)
For I=1 To UBound (Bs)/4
Arr (I)=Bs ((I - 1) * 4 + 4) * 16 ^ 6 + Bs ((I - 1) * 4 + 3) * 16 ^ 4 + Bs ((I - 1) * 4 + 2) * 16 ^ 2 + Bs ((I - 1) * 4 + 1)
A=Int (I - 1)/(8) + 2
B=I Mod 8
If b=0 Then b=8
Cells (a, b)=arr (I)

Next I
[a1: h1]=Split (" date, opening price (points), the highest (points), the lowest price (points), close (points), volume (points), volume, and unknown ", ", ")
End Sub



This code is opened marsh a file in the directory, and then analysis the stock price from the inside, it is not necessary to use vba, you directly use pb to achieve

If you want to use pb to implement the stock price, it is recommended that you use sina interface, the use, the reference link below

http://blog.csdn.net/simon803/article/details/7784682

Data can be used or geturl posturl, XMLHTTP can also be used to achieve

CodePudding user response:

Hello, I am want to go to the historical data, must be drawn from a file

CodePudding user response:

refer to the second floor of shennongjia reply:
hello, I am want to go to the historical data, must be extracted from the file


Write an example I try when you are free