我不断得到
运行时错误“9”:下标超出范围
我试图让用户确定他们想从QUANDL下载哪些股票
Dim stock1 As Variant
Dim stock2 As Variant
Dim i As Integer
Dim stock() As Variant
ReDim stock(i) As Variant
stock1 = InputBox("Stock? Enter all in uppercase")
stock2 = InputBox("Stock?")
Range("B2").Value = "YAHOO/" & stock1 & "/6"
Range("C2").Value = "YAHOO/" & stock2 & "/6"
For i = 3 To 30
If stock(i) = InputBox("Stock?") Then
Range(Cells(2, 1 + i)) = "YAHOO/" & stock(i) & "/6"
ElseIf stock(i) = "last" Then
Exit For
End If
Next i
该If stock(i) = inputbox("Stock?") Then
行不断收到错误。