1 Public Sub get_inter_info_bak(start_cow, start_clo, code, name) 2 3 Dim flag_up As String 4 5 flag_up = "↑" 6 7 8 URL = "http://download.finance.yahoo.com/d/quotes.csv?s=" & code & "&f=sl1c1p2l" 9 10 With CreateObject("msxml2.xmlhttp")11 12 .Open "GET", URL, False13 14 .send15 16 sp = Split(.responsetext, ",")17 18 If UBound(sp) > 3 Then19 20 Cells(start_cow, start_clo).Value = name21 22 Cells(start_cow, start_clo + 1).Value = sp(1)23 24 If sp(2) < 0 Then flag_up = "↓"25 Cells(start_cow, start_clo + 2).Value = flag_up & sp(2)26 27 n = Len(sp(3))28 Cells(start_cow, start_clo + 3).Value = Mid(sp(3), 2, n - 2)29 30 End If31 32 End With33 34 35 If flag_up = "↑" Then36 37 Worksheets("指数一覧").Cells(start_cow, start_clo).Font.Color = vbRed38 Worksheets("指数一覧").Cells(start_cow, start_clo + 1).Font.Color = vbRed39 Worksheets("指数一覧").Cells(start_cow, start_clo + 2).Font.Color = vbRed40 Worksheets("指数一覧").Cells(start_cow, start_clo + 3).Font.Color = vbRed41 42 Else43 44 Worksheets("指数一覧").Cells(start_cow, start_clo).Font.Color = vbGreen45 Worksheets("指数一覧").Cells(start_cow, start_clo + 1).Font.Color = vbGreen46 Worksheets("指数一覧").Cells(start_cow, start_clo + 2).Font.Color = vbGreen47 Worksheets("指数一覧").Cells(start_cow, start_clo + 3).Font.Color = vbGreen48 49 End If50 51 End Sub