1,488
社区成员
发帖
与我相关
我的任务
分享
Type 日线数据类型
a1 As Long '日期
a2 As Long '开盘价
a3 As Long '最高价
a4 As Long '最低价
a5 As Long '收盘价
a6 As Single '成交金额
a7 As Long '成交量
a8 As Long '保留
End Type
Sub 通达信日线数据()
Dim File2 As Integer
Dim b As 日线数据类型
File1 = FreeFile
Open ThisWorkbook.Path & "\SH600006.day" For Binary Access Read As #File1
i = 1
Do While Not EOF(File1)
Get #File1, , b
Cells(i, 1) = b.a1
Cells(i, 2) = (b.a2) / 100 '开盘价元
Cells(i, 3) = (b.a3) / 100 '最高价元
Cells(i, 4) = (b.a4) / 100 '最低价元
Cells(i, 5) = (b.a5) / 100 '收盘价元
Cells(i, 6) = (b.a6) / 10000 '成交金额 万
Cells(i, 7) = (b.a7) / 1000 '成交量 万股
Cells(i, 8) = (b.a8) / 100
i = i + 1
Loop
Close #File1
End Sub