vba下标越界 9
vba下标越界9WithSheets("组合数据")l=22.Range(.Cells(1,4),.Cells(1,4).Offset(0,temp-1))=ddd2Fo...
vba下标越界 9With Sheets("组合数据")l = 22.Range(.Cells(1, 4), .Cells(1, 4).Offset(0, temp - 1)) = ddd2For k = 2 To UBound(arr0, 1) ''''''''k记录基金 .Range(.Cells(2, 4), .Cells(2, 4).End(xlToRight).End(xlDown)).ClearContents .Range("a2") = arr0(k, 1) ccc = 0 ReDim hangyepeizhi(0, temp - 1), xuangushouyi(0, temp - 1) culmulate_r1 = 1 culmulate_r2 = 1 For j = 1 To temp ''''''''j记录列 d1 = ddd1(1, j) '季初 d2 = ddd2(1, j) '季末 For i = 1 To 20 ''''''记录行,基金只披露前20重仓股 Erase w_wss_data w_wss_data = vba_wss(arr0(k, 1), _ "prt_topstockname,prt_heavilyheldstocktostock,prt_heavilyheldstocksperchange", _ "rptDate=" & d2 & ";order=" & i & ";startDate=" & d1 & ";endDate=" & d2 & "", _ w_wss_codes, w_wss_fields, w_wss_times, w_wss_errorid) If IsEmpty(w_wss_data(0, 0, 0)) Then m = i Exit For Else ' .Range("c1").Offset(i, j) = Format(w_wss_data(0, 0, 0), "000000") .Range("c1").Offset(i, j) = w_wss_data(0, 0, 0) '''''''股票简称 c = .Range("c1").Offset(i, j) .Range("c1").Offset(i + 1 * l, j) = b(c) '''''''股票代码 .Range("c1").Offset(i + 2 * l, j) = w_wss_data(2, 0, 0) ''''''区间收益率 .Range("c1").Offset(i + 3 * l, j) = w_wss_data(1, 0, 0) '''''占比 End If Next i If i > 20 = False Then For i = m To 20 .Range("c1").Offset(i, j) = 0 '''''''股票简称 .Range("c1").Offset(i + l, j) = 0 ''''''股票代码 .Range("c1").Offset(i + 2 * l, j) = 0 '''''区间收益率 .Range("c1").Offset(i + 3 * l, j) = 0 '''''占比 .Range("c1").Offset(i + 4 * l, j) = 0 '''''所属行业 .Range("c1").Offset(i + 5 * l, j) = 0 '''''重仓股行业收益率 Next i Else: m = i End If b1.RemoveAll ''''''''''''''''''''用数据字典为了匹配重仓股行业收益 For i = 1 To b1row - 1 b1(arrc(i, 1)) = arrd(i, j) Next i arr1 = .Range("c24:c" & m + l).Offset(0, j) ''''''j列的股票代码 Erase w_wss_data2 w_wss_data2 = vba_wss(arr1, "industry_citic", "tradeDate=" & d2 & ";industryType=1", _ w_wss_codes, w_wss_fields, w_wss_times, w_wss_errorid) For i = 1 To m - 1 .Range("c89").Offset(i, j) = w_wss_data2(0, i - 1, 0) '''''所属行业 c1 = .Range("c89").Offset(i, j) .Range("c111").Offset(i, j) = b1(c1) '''''''重仓股行业收益率 Next i
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |