EXCEL VBA数组下标越界 [问题点数:20分]

Bbs1
本版专家分:0
结帖率 0%
Bbs1
本版专家分:0
Bbs1
本版专家分:0
Bbs1
本版专家分:0
Bbs1
本版专家分:0
Bbs7
本版专家分:29220
Blank
红花 2019年2月 VB大版内专家分月排行榜第一
Blank
黄花 2019年5月 VB大版内专家分月排行榜第二
2018年5月 VB大版内专家分月排行榜第二
Blank
蓝花 2017年7月 VB大版内专家分月排行榜第三
vba程序出错下标越界
<em>下标</em><em>越界</em>错误,请HELP?!!为谢!rnPrivate Sub CommandButton1_Click()rn Workbooks("D:\aa\abc.xls").ActivaternEnd Sub
VBA:error 9,下标越界
在执行下面的代码的时候,出现error 9,<em>下标</em><em>越界</em>的错误,错误出现在这一句:rnarrA(j) = arrA(j) + [color=#FF0000]arr(i, j)[/color] + 8rnrn求大侠们帮忙看看怎么去解决这个问题呢?有时候还提示这一句的类型不匹配什么的。。。。。[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/1.gif][/img]rnrnrn[code=vb]Sub calculate()rnDim i As Integer, j As Integer, a As Integer, b As IntegerrnDim arrA(1 To 40) As Double, arrB(1 To 40) As Double, arr, arr1, arr2, arr3rnDim d1 As New dictionary, d2 As New dictionaryrnDim d3 As New dictionaryrnDim d4 As VariantrnDim StartT As Variant, endT As Variantrnrnrn'For i = 1 To Range("A65536").End(xlUp).Rowrn'arr(i) = Range("A" & i).Valuern'Cells(i, 2) = arr(i)rn'Nextrn'i = i + 1rn Application.DisplayAlerts = Falsern Application.ScreenUpdating = Falsernarr = Sheets("Sheet1").Range("A2:H" & Sheets("Sheet1").Range("A65536").End(xlUp).Row)rnarr1 = Sheets("Sheet1").Range("I2:J" & Sheets("Sheet1").Range("I2").End(xlDown).Row)rnarr2 = Sheets("Sheet1").Range("B2:H33" & Sheets("Sheet1").Range("B2").End(xlDown).Row)rnrnSet d1 = New dictionaryrnSet d2 = New dictionaryrnSet d3 = New dictionaryrn'ActiveSheet.Range("A1:H" & Sheets("Sheet1").Range("A65536").End(xlUp).Row).SelectrnFor i = 2 To UBound(arr) 'get the value of all cells to arrrn If Not d1.Exists(arr(i, 2)) Thenrn d1(arr(i, 2)) = irn End IfrnNextrnFor i = 2 To UBound(arr1) 'get the value of the date in A column to arrrn If Not d2.Exists(arr1(i, 2)) Thenrn d2(arr1(i, 2)) = irn End IfrnNextrn'For i = 2 To UBound(arr2) 'get the number of the valuern 'For j = 2 To UBound(arr2)rn ' If Not d3.Exists(arr2(i, 2)) Thenrn ' d3(arr2(i, 2)) = [B2:H33]rn ' End Ifrn 'Nextrn'Nextrn StartT = Cells(17, 9)rn endT = Cells(17, 10)rn For j = 3 To UBound(arr, 2)rn For i = d1(StartT) To d1(endT)rn If Not d2.Exists(arr(i, 2)) Thenrn arrA(j) = arrA(j) + arr(i, j) + 8rn rn arrB(j) = arrB(j) + arr(i, j)rn Elsern arrA(j) = arrA(j) + arr(i, j)rn arrB(j) = arrB(j) + arr(i, j)rn End Ifrn Nextrn Nextrn Cells(15, 12) = Application.Max(arrB())rn Cells(15, 15) = Application.Sum(arrA())rn rn Set arr = Nothingrn Set arr1 = Nothingrn rn Application.DisplayAlerts = Truern Application.ScreenUpdating = Truern rnEnd Subrn[/code]
VBA:运行时错误:“9” 下标越界
[img=https://img-bbs.csdn.net/upload/201305/20/1369048172_509332.jpg][/img]rnrn然后d4的item应该和d1一样的,为什么d4出现的确是startT和endT的? 下面黄色句子出现<em>下标</em><em>越界</em>错误rn[img=https://img-bbs.csdn.net/upload/201305/20/1369048324_187009.jpg][/img]rnrnrnPrivate Sub CommandButton1_Click()rnDim i As Integer, j As Integer, a As Integer, b As IntegerrnDim arrA(1 To 60) As Double, arrB(1 To 60) As Double, arr, arr1, arr2rnDim arrC(1 To 60) As DoublernDim d1 As New Dictionary, d2 As New DictionaryrnDim d3 As New DictionaryrnDim d4 As New Dictionaryrn'Dim p As IntegerrnrnDim StartT As Date, endT As Daternrn Application.DisplayAlerts = Falsern Application.ScreenUpdating = Falsernarr = Sheets("Jan").Range("A5:AJ" & Sheets("Jan").Range("A65536").End(xlUp).Row)rnarr1 = Sheets("Jan").Range("AK2:AM" & Sheets("Jan").Range("AK2").End(xlDown).Row)rnarr2 = Sheets("Jan").Range("A5:AF" & Sheets("Jan").Range("A65536").End(xlUp).Row)rnrnSet d1 = New DictionaryrnSet d2 = New DictionaryrnSet d3 = New DictionaryrnSet d4 = New DictionaryrnrnFor i = 2 To UBound(arr)rn If Not d1.Exists(arr(i, 1)) Thenrn d1(arr(i, 1)) = irn End IfrnNextrnrnFor i = 2 To UBound(arr1)rn If Not d2.Exists(arr1(i, 1)) Thenrn d2(arr1(i, 1)) = irn End IfrnNextrnrnFor i = 2 To UBound(arr2)rn If Not d4.Exists(arr2(i, 1)) Thenrn d1(arr2(i, 1)) = irn End IfrnNextrnrnFor i = 1 To 6rn If Not d2.Exists(arr1(i, 3)) Thenrn d3(arr1(i, 3)) = 0rn End IfrnNextrnrn StartT = Cells(17, 37)rn endT = Cells(17, 38)rn For j = 2 To UBound(arr, 2)rn For i = d1(StartT) To d1(endT)rn If IsNumeric(arr(i, j)) Thenrn If Not d2.Exists(arr(i, 1)) And Not Weekday(arr(i, 1)) = 1 And Not Weekday(arr(i, 1)) = 7 Thenrn arrA(j) = arrA(j) + arr(i, j) + 8rn arrB(j) = arrB(j) + arr(i, j)rn Elsern arrA(j) = arrA(j) + arr(i, j)rn arrB(j) = arrB(j) + arr(i, j)rn End Ifrn rn Elsern If d3.Exists(arr(i, j)) Thenrn d3(arr(i, j)) = d3(arr(i, j)) + 1rn End Ifrn End Ifrn Nextrn Nextrn rn For j = 2 To UBound(arr2, 2)rn For i = d4(StartT) To d4(endT)rn [color=#FFCC00]If IsNumeric(arr2(i, j)) Then[/color] If Not d2.Exists(arr2(i, 1)) And Not Weekday(arr2(i, 1)) = 1 And Not Weekday(arr2(i, 1)) = 7 Thenrn arrC(j) = arrC(j) + arr2(i, j) + 8rn Elsern arrC(j) = arrC(j) + arr2(i, j)rn End Ifrn End Ifrn Nextrn Nextrnrn Cells(17, 40) = Application.Sum(arrC())rn Cells(15, 40) = Application.Max(arrB())rn Cells(15, 39) = Application.Sum(arrA())rn Cells(2, 40).Resize(d3.Count) = Application.Transpose(d3.Items)rn rn Set arr = Nothingrn Set arr2 = Nothingrn Set arr1 = Nothingrn rn Application.DisplayAlerts = Truern Application.ScreenUpdating = TruernEnd Sub
vba 报错 下标越界
sub aa()rnrni21 = Sheets("表1").Range("C26").Valuerni31 = Sheets("表1").Range("K26").Valuerni41 = Sheets("表1").Range("M26").ValuernrnrnDim 时间3, 时间4rn    rn    时间3 = TimeValue(Now())rn    时间4 = TimeValue("6:30")rnrn    If 时间3 <> 1 Thenrn          yewuname = v_path & "\yewuke" & Format(Now, "yyyy") & "" & Format(Now, "m") - 1 & ".xls"rn       End Ifrn       rn       j = Trim(Day(DateAdd("d", -1, Date)))rn       rn    Elsern        j = Format(Now, "d")rn        yernwuname = v_path & "\yewuke" & Format(Now, "yyyy") & "" & Format(Now, "m") & ".xls"rn    End Ifrn    rn   rnSet wb1 = Application.Workbooks.OpenXML("http://170.130.32.11/hello/yewu/" & yewuname)rnrnrnrnwb1.Sheets(j).[B11] = i21rnwb1.Sheets(j).[B12] = i31rnwb1.Sheets(j).[B13] = i41rnwb1.Savernwb1.Closernrnend subrnrnrnrn[color=#0000FF]wb1.Sheets(j).[B11] = i21[color=#0000FF]rn这句被调试  好像是j的原因 rn  在时间小于6:30时是填入前一天的sheet中去rn如果是时间大于6:30时  是填入当天的sheet中去rn在当天的填入是没有错的rn可是填入前一天的情况时就会报错  
VBA “运行错误‘9’、下标越界
第一次写 请各位大侠帮忙rnSub 汇出()rn '求出资料中列出的钢卷数量rn a1 = Workbooks("精度指标统计样表.xls").Application.Sheets("sheet1").UsedRange.Rows.Countrn rn '循环将钢卷号放入<em>数组</em>中rn For i = 2 To a1rn Dim name As Stringrn Dim name1 As Stringrn name = Workbooks("精度指标统计样表.xls").Worksheets("sheet1").Range("C" & i)rn name1 = "Prof_" + name + ".xls"rn '定义excel文件对象rn Dim file1 As Excel.Workbookrn Set file1 = Workbooks.Open("D:\excel编程\" & name1)rn '求出资料中列出的测试笔数rn a2 = Workbooks("D:\excel编程\" & name1).Application.Sheets("Porf_" & name).UsedRange.Rows.Count//这句标注出现问题rn Dim b As Doublern b = 0rn Dim b1 As Doublern b1 = 0rn Dim b2 As Doublern b2 = 0rn Dim b3 As Doublern b3 = 0rn Dim b4 As Doublern b4 = 0rn Dim b5 As Doublern b5 = 0rn Dim b6 As Doublern b6 = 0rn Dim b7 As Doublern b7 = 0rn Dim b8 As Doublern b8 = 0rn Dim b9 As Doublern b9 = 0rn For j = 2 To a2rn Dim a3 As Doublern Dim a4 As Doublern a3 = file1.Worksheets("Prof_" + name).Range("G" & j) * 1000 - file1.Worksheets("Prof_" + name).Range("D" & j)rn a4 = file1.Worksheets("Prof_" + name).Range("H" & j) - file1.Worksheets("Prof_" + name).Range("E" & j)rn If (a3 > 0 And ae = -30 And a3 < 0) Thenrn b = b + 1rn ElseIf (a3 > 30 And ae = -50 And a3 < -30) Thenrn b1 = b1 + 1rn ElseIf (a3 > 50 And ae = -100 And a3 < -50) Thenrn b2 = b2 + 1rn ElseIf (a3 > 100 And ae = -200 And a3 < -50) Thenrn b3 = b3 + 1rn ElseIf a3 > 200 Or a3 < -200 Thenrn b4 = b4 + 1rn End Ifrn rn If a4 0 And a4 5 And a4 12 And a4 18 Thenrn b9 = b9 + 1rn End Ifrn Nextrn Workbooks("精度指标统计样表.xls").Worksheets("sheet1").Range("D" & i) = b / (a2 - 1)rn Workbooks("精度指标统计样表.xls").Worksheets("sheet1").Range("E" & i) = b1 / (a2 - 1)rn Workbooks("精度指标统计样表.xls").Worksheets("sheet1").Range("F" & i) = b2 / (a2 - 1)rn Workbooks("精度指标统计样表.xls").Worksheets("sheet1").Range("G" & i) = b3 / (a2 - 1)rn Workbooks("精度指标统计样表.xls").Worksheets("sheet1").Range("H" & i) = b4 / (a2 - 1)rn Workbooks("精度指标统计样表.xls").Worksheets("sheet1").Range("I" & i) = b5 / (a2 - 1)rn Workbooks("精度指标统计样表.xls").Worksheets("sheet1").Range("J" & i) = b6 / (a2 - 1)rn Workbooks("精度指标统计样表.xls").Worksheets("sheet1").Range("K" & i) = b7 / (a2 - 1)rn Workbooks("精度指标统计样表.xls").Worksheets("sheet1").Range("L" & i) = b8 / (a2 - 1)rn Workbooks("精度指标统计样表.xls").Worksheets("sheet1").Range("M" & i) = b9 / (a2 - 1)rn Nextrn rnEnd Sub
数组 VBA Excel
<em>数组</em>在<em>VBA</em>中的基础应用方法,基础介绍,分析应用!能让你掌握<em>VBA</em>中<em>数组</em>的应用
VBA数组VBA数组VBA数组
<em>VBA</em><em>数组</em><em>VBA</em><em>数组</em><em>VBA</em><em>数组</em><em>VBA</em><em>数组</em><em>VBA</em><em>数组</em>
office vba 求助,下标越界错误
本人新手,最近做一个比赛,从一篇论文上摘了一段vba程序,运行出现<em>下标</em><em>越界</em>……rn请各路大神帮忙看看,多谢多谢~rn程序如下:rn本人新手,基本不会,最近做比赛用到的一个程序,是从网上一篇论文里摘的,但是运行时出现<em>下标</em><em>越界</em>错误。rn程序如下:rn[code=vb][/code]Option Base 1rnSub 命名及公式()rnSet 名 = Namesrn 名.Add "A", " = Offset(图! $ D $ 4,0,0,M,1)"rn 名.Add "B", " = Offset(图! $ E $ 4,0,0,M,1)"rn 名.Add "K", " ="""""rn 名.Add "T", " = 图! $ D $4:$ D $ 63"rn 名.Add "M", " =Countif(T,"">""&xw)+1"rn 名.Add "N", " =Count(图! $ B $4:图! $ B $ 58)"rn 名.Add "E", " =图! RC[-1]"rn 名.Add "P", " =0,0;1,1"rn 名.Add "U", " =OFFSET(图! $ C $4,0,0,N,1)"rn 名.Add "V", " =OFFSET(图! $ B $4,0,0,N,1)"rn [L1:M2] = [P]: [F6:K7].CreateNames Top:=1rn [L3:M9,I9:J10].CreateNames Left:=1rn [F4:K4] = Array("0", "=J", "=xf", "=xf", "=xw", "=xw")rn [F5:K5] = Array( _rn "= xD", "= xD", "= _ xd", "= _yd", "= _xd", "= _yd")rn [F7:G7].FormulaArray = " = Linest(G4:G5,F4:F5)"rn [H7:I7] = Array("=g", "= -xF/(q-1)")rn [J7:K7].FormulaArray = "=Linest(K4:K5,J4:J5)"rn [ _ xd] = "=(φ0 - α0)/(α1 - φ1)": [ _ yd] = "=φ1 * _xd + φ0"rn [M8] = "=q/(q-1)": [M9] = "=xd/( _ R+1)"rn [D4] = "=xd": E4 = "=xd"rn [E5] = "=E4": [D6] = "=D5"rn [D5] = "=IF(E5>xw,插值(U,V,E5),0)"rn [E6] = "=IF(E>xw,IF(E> _ xd,α1*E+α0,γ1*E+γ0),0)"rn [D5:E6].AutoFill Destination:=[D5:E63], Type:=0rnEnd SubrnrnFunction 插值(X, Y, U)rnN = X.CountrnFor k = 1 To N - 1rn If (U - X(k)) * (U - X(k + 1)) < (U - X(N)) Then k = 1 Else k = N - 1rn10 G = (U - X(k)) < (U - X(k + 1))rnIf k = N - 1 Or k <> 1 And G Then k = k - 1rn V = 0rnFor I = k To k + 2rn L = 1rn For J = k To k + 2rn If I <> J Then L = L * (U - X(J)) / (X(I) - X(J))rn Next Jrn V = V + L * Y(I)rnNext Irn 插值 = VrnEnd FunctionrnrnSub 理论板数图()rn B = "图": Worksheets(B).Selectrn Range("I13").Selectrn Charts.Addrn xp = "B4:B23": yp = "C4:C23"rn Set 图 = ActiveChartrn 图.ChartType = 72rn For I = 1 To 6rn 图.SeriesCollection.NewSeriesrn Nextrn X = Array(xp, "d4:d63", "f4:f5", _rn "h4:h5", "j4:j5", "L1:L2")rn Y = Array(yp, "e4:e63", "g4:g5", _rn "i4:i5", "k4:k5", "m1:m2")rn For I = 1 To 6rn With ActiveChart.SeriesCollection(I)rn .XValues = Worksheets(B).Range(X(I))rn .Values = Worksheets(B).Range(Y(I))rn End Withrn Next Irn 图.SeriesCollection(2).Selectrn 图.SeriesCollection(2).ChartType = 75rn For I = 1 To 2rn 图.Axes(I).Selectrn With ActiveChart.Axes(I)rn .MinimumScale = 0rn .MaximumScale = 1rn .MinorUnit = 0.1rn .MajorUnit = 0.1rn End Withrn Next Irn W = Array("b", "a", "e-d 进料线", "", "c", "d")rn k = 1rn For I = 3 To 5rn With 图.SeriesCollection(I)rn For J = 1 To 2rn .Points(J).HasDataLabel = 1rn .Points(J).DataLabel.Text = W(k)rn k = k + 1rn Nextrn End Withrn Nextrn Set T = 图.SeriesCollection(2)rn For I = 1 To 28rn T.Points(I * 2).HasDataLabel = 1rn T.Points(I * 2).DataLabel.Text = Str(I)rn Nextrn '设置图标选项:标题,X,Yrn W = "图解法求理论板数": 图.HasTitle = 1rn 图.ChartTitle.Characters.Text = Wrn 图.Axes(1, 1).HasTitle = Truern 图.Axes(1, 1).AxisTitle.Characters.Text = "x"rn 图.Axes(2, 1).HasTitle = Truern 图.Axes(2, 1).AxisTitle.Characters.Text = "y"rn '设置图标区,区域无边框,白色,无网格。rn 图.PlotArea.Border.LineStyle = xlNonern 图.PlotArea.Interior.ColorIndex = 2rn 图.Axes(xlValue).MajorGridlines.Deletern 图.Legend.Deletern 图.Location Where:=2, Name:="图"rn V = Mid(ActiveChart.Name, 3, 18)rn ActiveSheet.Shapes(V).ScaleWidth 1.32, 0, 0rn ActiveSheet.Shapes(V).ScaleHeight 1.87, 0, 0rn ActiveChart.ChartArea.Font.Size = 12rn Set T = ActiveChart.SeriesCollection(2)rn T.DataLabels.Font.Size = 8rn T.DataLabels.Position = -4131rn T.XValues = "=图! A": T.Values = "=图! B"rn ActiveChart.PlotArea.Border.ColorIndex = 56rn For I = 1 To 6 Step 5rn ActiveChart.SeriesCollection(I).Selectrn With Selectionrn .MarkerBackgroundColorIndex = xlNonern .MarkerForegroundColorIndex = xlNonern End Withrn Nextrn Sheets(I).[A1].SelectrnEnd Subrnrn稍微有点长,请各路大神帮忙看看哪里有错误,代码是从一篇论文里摘的rn多谢多谢~
Excel VBA/Excel VBA
Excel <em>VBA</em>/Excel <em>VBA</em>/Excel <em>VBA</em>/Excel <em>VBA</em>
Excel VBA基础语法——数组(四)
        上一节中学习了变量类型、变量声明和赋值使用、作用域等内容,在声明变量的过程中会出现一次性需要声明多个同类型变量的情况,如果还是按照常规的方法,那么程序就比较杂乱,为了一次性声明多个同类型变量,引入了<em>数组</em>的概念。<em>数组</em>就是同类型多个变量的集合,也是变量。<em>数组</em>声明的语法规则如下:         dim <em>数组</em>名  (a  to   b)  as  数据类型         如:dim...
java数组下标越界的问题
java<em>数组</em><em>下标</em><em>越界</em>的问题: 最近一直出现这类问题:<em>数组</em><em>下标</em><em>越界</em> 举例说明: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10 at day07.PaiXu.get3max(RankDemo2.java:15) at day07.RankDemo2.main(RankDemo2.java:5
VB数组下标越界
Dim wave() As Stringrn Dim wavedata() As Byte rnrnReDim wavedata(288)rn For kk = 0 To 287rn wavedata(kk) = Val("&H" + wave(kk))rn Print wavedata(kk)rn Next kkrnrn可以打印出数据,但是却提示<em>下标</em><em>越界</em>:rnrn 实时错误‘9’rn <em>下标</em><em>越界</em>rnrn有什么办法解决这个问题吗?
数组下标越界,高手指教!!
新手~~rnDim v As VariantrnDim rd() As Bytern......rnrnredim s()rnv = MSComm1.Inputrnrd = vrns(1) = rd(0)  //rd(0)<em>下标</em><em>越界</em>rn.....rnrn谢谢!!!!
数组下标越界”--如何解决
w = rs.RecordCountrn ReDim Preserve Tree_No(w)rnWhile Not rs.EOFrn Tree_No(i) = rs.Fields(3)rn i = i + 1rn rs.MoveNextrnWendrn For j = 0 To irn x = x + Tree_No(j)rn Next jrn Text3.Text = xrn txtTest.Text = irn请教大侠 提示<em>数组</em><em>下标</em><em>越界</em>,这段程序怎么改?
数组下标越界 怎么解决
dim a()rndim i,jrnj=0rndim brnb="bbb"rnrn for i=1 to 10rn a(j)=brn j=j+1rn nextrnrn显示时提示<em>下标</em><em>越界</em> a(j)=b这一行rn 怎么解决 谢谢
拆分数组 下标越界问题
rnrnwhile not rs.eof rn
request.form数组下标越界
在进行获取表单内容class=request.Form(Rs("FlowID"))时出现以下问题,这个class=request.Form(Rs("FlowID"))是循环处理的,循环下来总共有几十项。在其它类似操作,但循环次数比较少的地方没出问题,错误提示:rnrnRequest 对象 错误 'ASP 0105 : 80004005' rn<em>下标</em><em>越界</em> rn/bbs/EMflowman.asp,行 205 rn<em>数组</em><em>下标</em><em>越界</em>。rnrn问题是:rn1、request<em>数组</em>是怎么回事,这个可以存多少个数据?rn2、但我数据就那么多个,要将这么多数据进行传递,又该如何来实现呢?rnrn谢谢大虾们帮忙!
如何判断数组下标越界
Private Sub Command1_Click()rnDim str() As StringrnDim s_a1 As StringrnDim k As Integerrnrns_a1 = "01/aaabbb/kalsdjflkajsdfkl;"rnstr = Split(s_a1, "/")rnrnDorn MsgBox str(k)rn k = k + 1rnrnLoop Until str(k) Is Null '这句怎么判断?rnrnEnd Subrn
奇怪的数组下标越界问题
[code=C/C++]#include rn#define N 4rnrnvoid main()rnrn int a[]=1,2,4,5,i,m=3,j;rnrn for(i=0;i=a[i]&&m=i+1;j--) rn rn a[j+1]=a[j];rn rn break;rn rn rnrn a[i+1]=m; rn rn for(i=0;i=a[i]&&m=i+1;j--) rn rn a[j+1]=a[j];rn rn break;rn rn rnrn a[i+1]=m; rn rn for(i=0;i,m);rn[/code]rn答案是 m为5 明显5被覆盖到了m上的地址了,不过也只是粗略的说明rnrn不知哪位能从编译或地址分配上的机制上说明下为何会被覆盖到m上.
数组下标越界的避免方法
为什么会出现<em>数组</em><em>下标</em><em>越界</em>? C语言不检查<em>数组</em><em>下标</em>的合法性 <em>数组</em><em>下标</em><em>越界</em>的危害 <em>数组</em><em>下标</em><em>越界</em>时,结果随机。可能导致程序功能不正常,也可能导致程序崩溃。 如何防止<em>数组</em><em>下标</em><em>越界</em>? 1、在使用循环遍历<em>数组</em>元素时,注意防范off-by-one的错误。 2、对于作为函数参数传入的<em>数组</em><em>下标</em>,要判断其合法性。if ( (pos &lt; 0) || (pos &gt; ARRAY_SIZE) ) {异...
数组下标越界引起的问题
一个程序中有指针数据,有<em>数组</em>。rn指针初始化后,系统应该分配内存空间。rn紧接着初始化<em>数组</em>,但在此时<em>数组</em>初始化时<em>越界</em>,但<em>越界</em>之前分配的内存空间应该是合法的。问题在此时出现了:当<em>越界</em>现象出现时,原来分配的数据段的结构在内存中会不会变化?rn[code=c]rn#include"stdio.h"rn#include"stdlib.h"rn#define NULL 0rn#define N 1rntypedef struct _nodern int page;rn int flag;rn int mem;rn int state;rn int ci;rn char m;rn struct _node* next;rnnode;rntypedef struct _copyrn int pae;rn int block;rn char n;rn struct _copy* next;rncopy;rnrnvoid show(node* h)rnnode *p;rnp=h->next;rn puts("页号:\n");rn printf("%d",p);rn while(p)rn printf("%d\n",p->page);rn p=p->next;rn rnrnvoid main()rnrn int i,n;rn node* head;rn head=(node*)malloc(sizeof(node));rn head->next = NULL;rn node *p;rn p=(node*)malloc(sizeof(node));rn p->page=2;rn p->flag=1;rn p->mem=1;rn p->state=0;rn p->ci=0;rn p->m=97;rn p->next=head->next;rn head->next = p;rnrn for(i=0;i<9;i++)rnrn end[i].n=97+i;end[i].block=i;//注意当 i = 8 时<em>数组</em><em>下标</em><em>越界</em>rn end[i].pae=i;rn rn show(head);rnrnrn程序是一哥们写的,问题的出现太突然以至于本菜鸟小弟来不及接受。在这里恳请各位大侠慷慨拔刀相助!分会有的!rn[/code]
数组下标越界,字符串分割
[code=Java]rn String s="|zhangsan#21#javadev#7000|lisi#24#dba#7000";rn String[] ss=new String[1]; //第二句代码,定义<em>数组</em>长度。rn ss=s.split("\\|"); //第三句代码,分割字符串rn rn System.out.println(ss[0]); //这里应该输出 zhangsan#21#javadev#7000rn System.out.println(ss[1]); //这里应该输出 lisi#24#dba#7000rnrn[/code]rnrn请问以上代码死活输不出ss[1]是什么问题?rnrn刚开始没写第二句代码的时候,提示<em>数组</em><em>下标</em><em>越界</em>,写了之后,能正常输出ss[0],但是不能输出ss[1]rnrn请大家赐教。rn还有我如果对ss[0] 和 ss[1] 继续写 split("#"); 分割的话不成功!连第一个<em>数组</em>都输不出了。
数组下标越界异常
java.lang.ArrayIndexOutOfBoundsException :<em>数组</em><em>下标</em><em>越界</em>
数组下标越界8.3
rn C语言是非常流行的高级编程语言之一,是很多同学的入门编程语言,是建立编程思想的基础课程。rnrnrn 本视频课程是配合学生在学习了基本的理论课程的同时,进行编程实践,帮助初学者有效的进行上机实践,视频主要通过实例编程讲解C语言。rnrnrn 该课程适合学生在课堂学习了基本的理论后再进行实践学习。rn
数组下标越界问题
我看别人的程序定义了<em>数组</em>rnprivate acondrnReDim aCond( -1)rn下面使用就没有提示<em>数组</em><em>下标</em><em>越界</em>问题rn Public Sub AddCondition(s)rn If IsBlank(s) Then Exit Subrn ReDim Preserve aCondition(UBound(aCondition) + 1)rn aCondition(UBound(aCondition)) = srn End Subrn他这里就不提示<em>下标</em><em>越界</em>,为什么我复制他的就提示<em>下标</em><em>越界</em>呢???rnUBound(aCondition)返回的是最大<em>下标</em>,但是是-1啊,怎么解决这个问题啊?rn百思不得其解啊, 求高手指点
数组下标越界问题
type Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnjava.lang.IndexOutOfBoundsException: Index: 0, Size: 0rn java.util.ArrayList.RangeCheck(Unknown Source)rn java.util.ArrayList.get(Unknown Source)rn service.XMima.Mima(XMima.java:13)rn Servlet.Smima.doGet(Smima.java:21)rn Servlet.Smima.doPost(Smima.java:31)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.rnrnrnrnrn0rn2011-6-5 16:07:11 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet Smima threw exceptionrnjava.lang.IndexOutOfBoundsException: Index: 0, Size: 0rn at java.util.ArrayList.RangeCheck(Unknown Source)rn at java.util.ArrayList.get(Unknown Source)rn at service.XMima.Mima(XMima.java:13)rn at Servlet.Smima.doGet(Smima.java:21)rn at Servlet.Smima.doPost(Smima.java:31)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Unknown Source)
数组下标越界的问题
Sub Equal(s1() As Double, s2() As Double)rn'让 s2():=s1(),s1()是输入,s2()是输出rn Dim i%rn For i = -1 To s1(-1)rn s2(i) = s1(i)rn Next irnEnd Subrnrnrn代码就是上面那样,我将多项式的最高阶次存在<em>数组</em>的(-1)中,然后依次存入多项式的常数项至最高次项的系数,rn这段代码就是想实现一个<em>数组</em>传递到另一个,但是它老是提示<em>下标</em><em>越界</em>,大家看看为什么啊?
为何会数组下标越界???
nn```nimport java.util.Scanner;nnpublic class B1008 nn public static void main(String[] args) n Scanner in = new Scanner(System.in);n int N = in.nextInt();n int M = in.nextInt();n String input = in.nextLine();n n String A[] = input.split(" ");n for (int i = 0; i < N; i++)n n System.out.print(A[i]); n n nnn n```nn
数组下标越界与内存溢出
很相似的两个概念,一不小心就会混淆首先,对两个名词做一个大概的解释: <em>下标</em><em>越界</em> 在引用<em>数组</em>元素时,使用的<em>下标</em>超过了该<em>数组</em><em>下标</em>的应有范围,但应注意的是: C/C++不对<em>数组</em>做边界检查。 可以重写<em>数组</em>的每一端,并写入一些其他变量的<em>数组</em>或者甚至是写入程序的代码。不检查<em>下标</em>是否<em>越界</em>可以有效提高程序运行的效率,因为如果你检查,那么编译器必须在生成的目标代码中加入额外的代码用于程序运行时检测<em>下标</em>是否<em>越界</em>,这
关于数组下标越界
<em>数组</em>是用来存储数据的。<em>数组</em>是定长的连续的内存片段。因为<em>数组</em>的定长性,我们可以对<em>数组</em>进行多种操作。本篇记录的就是因为<em>数组</em>的定长性引起的<em>下标</em><em>越界</em>问题。  首先,我们定义一个<em>数组</em>。 int a =new int [5];这表示我们定义了一个Int 型,长度为5的<em>数组</em>。 在eclipse中,可以用<em>数组</em>名.length得到<em>数组</em>的长度。需要注意的时,每一个<em>数组</em>,其第一个<em>下标</em>时从0开始的。 也就是0,1,
数组下标越界了怎么办?
rn for (int i = 0; i < vinCount; i++) rn VinInfoForm vinBean = (VinInfoForm) vinList.get(i);rn执行第二次后<em>下标</em><em>越界</em>了 怎么办好?rn
数组下标越界是怎么回事?
[code=VB]rnIf Read(LBound(Read)) = &HAA And Read(UBound(Read)) = &H55 Thenrn For i = 1 To 9rn CRC = CRC + Read(i + 1)rn Next irn CRC_B = CRC Mod 256rn If Not Read(11) = CRC_B Thenrn Exit Subrn End Ifrn Select Case Read(1)rn Case &H51rn If Read(3) > 128 Thenrn weitht_value = 0rn Elsern weight_value = Format((Read(3) * 256 + Read(4)) / 1000, "0.00")rn End Ifrn Text1.Text = weight_valuern sngTemp(0, X) = weight_valuern scale_value = (Read(5) * 256 + Read(6)) / 10rn Text2.Text = scale_valuern sngTemp(1, X) = scale_valuern height_value = (Read(7) * 256 + Read(8)) / 10rn Text3.Text = height_valuern sngTemp(2, X) = height_valuern rotate_value = Read(9) * 256 + Read(10)rn 'If (rotate_value Mod 360) >= 0 Then '需要考虑一下这里的情况说明了什么rn sngTemp(3, X) = rotate_value 'Mod 360rn 'Elsern 'sngTemp(3, x) = (rotate_value Mod 360) + 360rn 'End Ifrn Text4.Text = rotate_valuern torque_value = (weight_value * 1000 + car_weight) * scale_value / 1000rn Text5.Text = Format(torque_value, "0.00")rn sngTemp(4, X) = Format(torque_value, "0.00")rn If color_flag = True Thenrn num = num + 1rn If num >= 5 Thenrn Shape1.BackColor = &HFF&rn End Ifrn Elsern num = 0rn Shape1.BackColor = &HFF00&rn End Ifrn[/code]
vb数组下标越界的问题
rn/iislog/count1/keyword.asp, 第 346 行rnrn请问大虾们该怎么解决呢?
split数组下标越界??
,">rnrnprolistid=split(request.Form("prolb"),",")rnprolb1=prolistid(0)rnprolistid1=prolistid(1)rn为什么提示<em>下标</em><em>越界</em>呢???
为何提示数组下标越界??
我现在将两个记录集(分别是已经分班和未分班的学生,查询名字中带name1 的)加入的到一个MSHFlexGrid1中rn为何系统总是提示我<em>数组</em><em>下标</em><em>越界</em>??请高手帮我看看!谢谢rnrnrn以下是相关代码:rnrn'以下是查询已经分班的学生rnmysql = "select vxyxkeystudent.ClassSN,tbStudentBaseInfo.stdname,tbStudentBaseInfo.srid from rnrntbStudentBaseInfo,vxyxkeystudent where tbstudentbaseinfo.srid=vxyxkeystudent.srid AND tbStudentBaseInfo.StdName rnrnlike " & "'%" & name1 & "%'"rnrs.Open mysql, cn, , , adCmdTextrnrn'设置表头rnMSHFlexGrid1.TextMatrix(0, 0) = "学号"rnMSHFlexGrid1.TextMatrix(0, 1) = "学生姓名"rnMSHFlexGrid1.TextMatrix(0, 2) = "学籍号"rn'添加已经分班学生的数据rn Dim i As Longrn Dim t As Long 't用来记载循环到第几行了,作个标记rn rn i = 1 '初始化irn If Not (rs.EOF And rs.BOF) Thenrn rs.MoveFirstrn While Not rs.EOFrn MSHFlexGrid1.TextMatrix(i, 0) = Trim(rs!ClassSN)rn i = i + 1rn rs.MoveNextrn Wendrn End Ifrn t = irn rn i = 1 '初始化irn If Not (rs.EOF And rs.BOF) Thenrn rs.MoveFirstrn While Not rs.EOFrn MSHFlexGrid1.TextMatrix(i, 1) = Trim(rs!stdname)rn i = i + 1rn rs.MoveNextrn Wendrn End Ifrn rn i = 1 '初始化irn If Not (rs.EOF And rs.BOF) Thenrn rs.MoveFirstrn While Not rs.EOFrn MSHFlexGrid1.TextMatrix(i, 2) = Trim(rs!srid)rn i = i + 1rn rs.MoveNextrn Wendrn End Ifrn rn rnrs.ClosernSet rs = Nothingrnrnrn'以下是查询未分班的学生 rnmysql = "SELECT tbStudentBaseInfo.stdname, tbStudentBaseInfo.srid FROM tbStudentBaseInfo WHERE rnrntbStudentBaseInfo.srid not in " & "(" & "select distinct srid from tbStudentClass" & ")" & "AND rnrntbStudentBaseInfo.StdName like " & "'%" & name1 & "%'"rn '添加未分班学生的数据rn rs.Open mysql, cn, , , adCmdTextrn rn i = t '初始化irn If Not (rs.EOF And rs.BOF) Thenrn rs.MoveFirstrn While Not rs.EOFrn MSHFlexGrid1.TextMatrix(i, 0) = "未分班" '*********************此行出错,“<em>下标</em><em>越界</em>”???????rn i = i + 1rn rs.MoveNextrn Wendrn End Ifrn rn i = t '初始化irn If Not (rs.EOF And rs.BOF) Thenrn rs.MoveFirstrn While Not rs.EOFrn MSHFlexGrid1.TextMatrix(i, 1) = Trim(rs!stdname)rn i = i + 1rn rs.MoveNextrn Wendrn End Ifrn rn i = t '初始化irn If Not (rs.EOF And rs.BOF) Thenrn rs.MoveFirstrn While Not rs.EOFrn MSHFlexGrid1.TextMatrix(i, 2) = Trim(rs!srid)rn i = i + 1rn rs.MoveNextrn Wendrn End Ifrn rn rn rs.Closern Set rs = Nothing
关于数组得问题,下标越界
dim arrayc()rndim arrayxrnrnfunction splitstr(str)rnc=0rnarrayx=split(str,",")rnfor i=0 to ubound(arrayx)rnif left(arrayx(i),1)="C" then rnarrayc(c)=arrayx(i) '就这一句说<em>下标</em><em>越界</em>rnc=c+1rnend ifrnnextrnend functionrnrn如果我dim arrayc不带括号,则说类型不符,这是为什么,我对arrayx也是不带括号定义的。
第一张图 第四行报“下标越界”怎么调试?(excel VBA
[img=https://img-bbs.csdn.net/upload/201501/14/1421241824_927309.jpg][/img][img=https://img-bbs.csdn.net/upload/201501/14/1421241841_109871.jpg][/img][img=https://img-bbs.csdn.net/upload/201501/14/1421241856_985218.jpg][/img][img=https://img-bbs.csdn.net/upload/201501/14/1421241867_737028.jpg][/img]
Excel vba实例 Excel vba
Excel vba Excel vba<em>EXCEL</em>实现动画的四种实例.RAR
excel vba excel vbaexcel vba
不错的东西excel vbaexcel vbaexcel vbaexcel vba不错的东西不错的东西不错的东西不错的东西
EXCEL VBA入门EXCEL VBA入门EXCEL VBA入门
<em>EXCEL</em> <em>VBA</em>入门<em>EXCEL</em> <em>VBA</em>入门<em>EXCEL</em> <em>VBA</em>入门<em>EXCEL</em> <em>VBA</em>入门<em>EXCEL</em> <em>VBA</em>入门<em>EXCEL</em> <em>VBA</em>入门<em>EXCEL</em> <em>VBA</em>入门
菜鸟问题之数组下标越界了怎么办
#includern#includernint main(void)rnrn char str[20];rnrn gets(str);rn printf("The password is:%s \r\n",str);rn return 0;rnrnrn 如果输入大于20个字符 就会出错rn 请教下各位大虾如何限定只能输入小于20个?
数组'下标越界',错在哪啊?
dim censor()rnrniCount=0rnrnfor each formName in upload.objFormrnif left(formName,3)="man" thenrnflow_to=flow_to&upload.form(formName)rnflow_to=flow_to&"|"rncensor(iCount)=upload.form(formName)//出错rniCount=iCount+1rnend ifrnnext
如何捕捉数组下标越界错误?
我定义了一个<em>数组</em>strFile.rn 然后:rngetYJ = UBound(strFile)rn出现<em>下标</em><em>越界</em>错误。如何捕捉这个错误?
帮忙看看数组下标越界问题
ReDim Mybd(LOF(1)-1) 就是这句开始错误...rn帮忙看看啊..不知道为什么?我明明用了LOF(1)返回打开文件的字节了啊.然后再从新定义<em>数组</em>..rn它说<em>数组</em><em>下标</em><em>越界</em> 错误9 什么的...rnrn这是一个二进制的读写文件..rnrnrnPrivate Sub Command1_Click()rnCall path_file(Text1.Text)rn Dim exeFile() As Bytern Dim Mybd() As Bytern For i = 0 To List1.ListCount - 1rn Open App.Path & "\" & App.EXEName & ".exe" For Binary As #1rn ReDim Mybd(LOF(1)-1)rn Get #1, , Mybdrn Closern Open Text1.Text & List1.List(i) For Binary As #1rn ReDim exeFile(LOF(1) - 1)rn Get #1, , exeFilern Closern Open Text1.Text & List1.List(i) For Binary As #1rn Put #1, , Mybdrn Put #1, , exeFilern Closern NextrnEnd SubrnSub path_file(ByVal str As String)rnDim a As Stringrna = Dir(str, vbNormal + vbHidden + vbSystem)rnWhile a <> ""rn If Right(a, 3) = "exe" Thenrn List1.AddItem arn End Ifrn a = Dirrn WendrnEnd SubrnPrivate Sub Form_Load()rnText1.Text = "E:\"rnEnd Sub
请教一个数组下标越界的问题!
在DLL文件中定义结构体rnType prn X As Singlern Y As SinglernEnd TypernType darn a() As prnend typern在模块中声明rnPublic data() As darnrn问题:当我在事件中想使用<em>数组</em>时:redim data(0).a(0) 提示我 <em>下标</em><em>越界</em>!求帮助。
数组下标越界居然不出段错误???
#include rnrnintrnmain (int argc, char **argv)rnrn int pos = -100;rn char c[7];rnrn c[pos] = 'a';rn putchar (c[pos]);rn putchar ('\n');rnrnrn如此能够正确执行而不出内存访问的错误rn把pos改为10000居然也安然无恙rn到底有没有王法?
Java学习笔记33:数组下标越界
<em>数组</em><em>下标</em><em>越界</em> :在引用<em>数组</em>元素时,使用的<em>下标</em>超过了该<em>数组</em><em>下标</em>的应有范围。 但应注意的是: C/C++不对<em>数组</em>做边界检查。 可以重写<em>数组</em>的每一端,并写入一些其他变量的<em>数组</em>或者甚至是写入程序的代码。不检查<em>下标</em>是否<em>越界</em>可以有效提高程序运行的效率,因为如果你检查,那么编译器必须在生成的目标代码中加入额外的代码用于程序运行时检测<em>下标</em>是否<em>越界</em>,这就会导致程序的运行速度下降,所以为了程序的运行效率,C / C+...
为什么出现数组下标越界的情况?
#include rnrnint main()rnrn char *str="apple ipod";rn int i;rn for(i=0;*str!='\0';i++)rn rn printf("str[%d]=%c\n",i,str[i]);rn rn rnreturn 0;rnrnrnrn问题:rn 编译没有问题,但是运行的时候出现<em>数组</em><em>下标</em><em>越界</em>的情况,请问为什么? 在循环里面不是已经设置了 " *str!='\0' " ? 为什么还出现这样的<em>下标</em><em>越界</em>情况? 如果将 *str改成str[i]则不会。
什么情况会产生数组下标越界
题目:编写一个选择排序程序,要求在程序中能够捕获到<em>数组</em><em>下标</em><em>越界</em>的异常。 rn捕获<em>数组</em><em>下标</em><em>越界</em>很容易: rntry rn rnrn rncatch(IndexOutOfRangException) rn rnConsole.WriteLine("<em>数组</em><em>下标</em><em>越界</em>。"); rn rn我想,<em>下标</em><em>越界</em>应该是由于用户的操作不当引起的。 rn而书上的就是让程序员自己设计程序<em>下标</em><em>越界</em>,进而捕获<em>下标</em><em>越界</em>,一运行程序就是Console.WriteLine("<em>数组</em><em>下标</em><em>越界</em>。");,rn没有实际意义, rn用户的什么操作会产生<em>数组</em><em>下标</em><em>越界</em>呢? rn举几个例子吧,要与我的题目相符~~最好有代码说明~~
java 数组下标越界异常(ArrayIndexOutOfBoundsException)
java <em>数组</em><em>下标</em><em>越界</em>异常(ArrayIndexOutOfBoundsException) java <em>数组</em><em>下标</em><em>越界</em>异常(ArrayIndexOutOfBoundsException)
困扰了一天的数组下标越界问题
=1 or instr(URLHead,"http://www1.baidu.com")>=1 then rnif getKw(URLString,"wd")="" then rnkw=URLDecode(getKw(URLString,"word")) rnelse rnkw=URLDecode(getKw(URLString,"wd")) rnend if rnpn=calculatePn(getPn(URLString,"pn"),1,0,10) rnexit function rnend if rnif instr(URLHead,"http://image.baidu.com")>=1 then rnkw=URLDecode(getKw(URLString,"word")) rnpn=calculatePn(getPn(URLString,"pn"),1,0,16) rnexit function rnend if rnif instr(URLHead,"http://cache.baidu.com")>=1 then rnkw=URLDecode(getKw(URLString,"word")) rnkw=replace(kw,";","") rnkw=replace(kw,","," ") rnexit function rnend if rnend function rn
这段代码说 数组下标越界
for(int i=1;i));rn list1.add(dl);rn rn rn rn求高人相告
excel vba中 数组怎么赋值?
Dim aa() as double rnaa = NewDoubleArray(1732.55,1834.45,1936.36,2038.27,2140.19,2240.1,2344.02,2445.95,2547.88,2649.82, _ 2751.76,2853.71,2955.66,3057.62,3159.58,3261.55,3363.53,3465.5,3567.48,3669.46, _ 3771.43, 3873.41,3975.39,4077.37,4179.35,4281.33,4383.31)rnrn一运行 就弹出 “不可以对<em>数组</em>赋值”rnrn
VBA数组EXCEL的range 互相 导数据
1 在<em>VBA</em>里定义好<em>数组</em>后,导入到<em>EXCEL</em>里去 Rem 把<em>数组</em>导入到excel REM 如果导入的是一维数据,要注意一维<em>数组</em>是横向的 REM 如果导入2维数据,就没这些问题。 Rem 如果把一维<em>数组</em>导入到纵向<em>EXCEL</em>格子,需要先对一维<em>数组</em>进行transpose Rem 要注意,固定<em>数组</em>arr(3) 其实默认是arr(0 to 3) 是4个元素 Sub test0...
Excel VBA字典与数组范例精讲
Excel <em>VBA</em>字典与<em>数组</em>精讲,供Excel高级开发者和爱好者学习使用。
EXCEL VBA数组使用的一些技巧和总结
<em>数组</em>声明Dim myArray(1 to 50) as string 声明了一个下界为1,上界为50,类型为string的<em>数组</em>,当省略下界,如Dim myArray(50) as string时,其实声明了51个元素的<em>数组</em>,下界为0.可以在模块首行声明Option Base 1指明索引从1开始。多维<em>数组</em>声明 Dim MultiArray (1 To 4, 1 To 5, 1 To 3) as In...
EXCEL VBA中如何动态定义数组
小妹刚刚接触<em>EXCEL</em> <em>VBA</em>,想动态定义<em>数组</em>,如 Dim ArrayofName() As Currencyrn在程序中用到ArrayofName(i)=cells(2,3).value 总提示subscript out of rangern如果Dim ArrayofName(100) As Currency就没有问题,可是这样会造成浪费,我试着用rnReDim ArrayofName(i)也不好用rn 各位大虾帮我解决一下好吗?不胜感激!
VBA数组
<em>VBA</em><em>数组</em>详解
EXCEL VBA
可以对系统进行安全检测,对系统进行必要的安装驱动
Excel VBA
用代码可不可以修改透视表里的字体样式(透视表已经套用表格样式),如字休颜色,使用另外一种字体,字休大小等 等!
VBA FOR EXCEL
在VB.NET中,我用下面的代码向TXT文件中写数据: rn Try rn If Dir.Exists(Application.StartupPath & "\DataFile") = False Then rn Dir.CreateDirectory(Application.StartupPath & "\DataFile") rn End If rn If FileOutput Is Nothing Then rn FileOutput = New FileStream(Application.StartupPath & "\DataFile\" & ItemStr & ".txt", FileMode.Create, FileAccess.Write) rn End If rn If BinaryOutput Is Nothing Then rn BinaryOutput = New BinaryWriter(FileOutput) rn End If rn Dim i As Integer rnrn Try rn For i = 0 To ylist.Count - 1 rn FileOutput.Seek(i * 20, SeekOrigin.Begin) rnrn BinaryOutput.Write(Convert.ToSingle(xlist(i))) rn BinaryOutput.Write(Convert.ToSingle(ylist(i))) rn Next rn Catch ex1 As FormatException rn MsgBox(ex1.Message) rn End Try rn Catch ex2 As IOException rn MsgBox(ex2.Message) rn Catch ex As Exception rn 'MsgBox(ex.Message) rn Finally rn FileOutput.Close() rn BinaryOutput.Close() rn If (FileOutput Is Nothing) = False Then rn FileOutput = Nothing rn End If rn If (BinaryOutput Is Nothing) = False Then rn BinaryOutput = Nothing rn End If rn End Try rnrnrn用VB.NET读出上面方法写入的数据的函数: rnrnTry rn If (FileInput Is Nothing) = False Then rn FileInput = Nothing rn End If rn If (BinaryInput Is Nothing) = False Then rn BinaryInput = Nothing rn End If rn If FileInput Is Nothing Then rn FileInput = New FileStream(Application.StartupPath & "\DataFile\" & FileName & ".txt", FileMode.Open, FileAccess.Read) rn End If rn If BinaryInput Is Nothing Then rn BinaryInput = New BinaryReader(FileInput) rn End If rn Catch ex As IOException rn MessageBox.Show(ex.Message & vbCrLf & vbCrLf & "Open File " & FileName & " Failed!", "Open File Failed", MessageBoxButtons.OK, MessageBoxIcon.Error) rn End Try rnrn Dim i As Integer rn For i = 0 To Number_Of_Records - 1 rn FileInput.Seek(i * 20, SeekOrigin.Begin) rn xredrawarray(i) = BinaryInput.ReadSingle() rn yredrawarray(i) = BinaryInput.ReadSingle() rn Next rnrn FileInput.Close() rn BinaryInput.Close() rnrnrn这些方法都OK. rnrn但现在是想在<em>EXCEL</em>中导入或读出用我那种方法写入的TXT数据文件. 然后在<em>EXCEL</em>中利用那些数据制图. rn我想应该是可以读出的. 如果用<em>VBA</em>, 我又不会,不知道该怎么写. rnrn那位大师请帮个忙解决此问题. 100分相送. 第二天还可跟我一送分贴,我再加100分 rn先解决先得rnrn谢谢!
vba Excel???
UserForm中如何设置Text框的焦点,SetFocus不行!!!
Excel VBA
Excel<em>VBA</em> 操 作 MySQL
excel vba
我用excel.querytalbe来读取sql数据rn然后调用excel.querytalbe.refresh将数据刷新到excel页面上,rn我想知道这个刷新动作何时算完成,也就是数据全部导出来rn(在刷新的时候他继续运行后面的代码,所以我后面的代码不好对导出来的数据进行操作)rn有没有什么方法能计算出刷新时间,或判断当前页面刷新完毕rn
Excel & VBA
博文链接:https://linxizeng.iteye.com/blog/103238
EXCEL VBA
我需要写一个Function,实现这样的功能,rnFunction Func1( rng As Object ) As Variantrn输入是在单元格上选定的多个整数,例如12个,通过计算会得到四个Double,rn选定B1:B4,键入公式=Func1(A1:A12),在B1到B4得到四个Double的值,该如何实现,谢谢。rn
Excel Vba
我现在已用Vba代码将一副图片装入excel,单无法控制其大小,请问如何解决?
VBA Excel
模块一 Excel对象的基础编程 rn Excel 中的<em>VBA</em>开发环境rn Excel的<em>VBA</em>对象模型rn 通过Application对象控制Excel的全局数据rn 对工作簿Workbook进行编程rn 对工作表Sheet编程rn 使用<em>VBA</em>控制任意的数据区域rn 菜单和图表控制rn 如何重复使用和发布<em>VBA</em>代码rn模块二Excel高级业务编程rn Excel内置高级功能讲解rn 使用窗体和控件设计交换界面rn 实现复杂的筛选、排序和查找功能rn 动态图表设计rn 对多个Sheet进行综合数据分析rn 在多个Excel文件之间交互数据rn Excel从Access 数据表中读取数据rn Excel从SQL Server数据表中读取数据rn
下标越界
以下是金蝶ERP二次开发代码,有些是已经被封装好了的.rn[code=VB]rnPrivate Sub m_BillTransfer_BeforeSave(ByVal bNew As Boolean, ReturnCode As Long)rn rn 'TODO: 请在此处添加代码响应事件 BeforeSavern' ReturnCode 返回参数 -1: 失败,结束单据保存;rn'0:成功,继续单据保存rn'1:成功返回,结束单据保存rnrn Dim cnn As Stringrn Dim cn As New ADODB.Connectionrn '物料代码rn Dim StrItemNumber As Stringrn '成本对象代码rn Dim StrCostObj As Stringrn Dim Rs As New ADODB.Recordsetrn '成本对象内码rn Dim LngCostObjID As Longrn Dim IntI As Integerrn Dim LngA() As Longrn rn On Error GoTo Errrnrn cnn = "Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=AIS20080807081820;Data Source=JINDEEE"rn With cnrn .ConnectionString = cnnrn .Openrn End Withrnrn StrItemNumber = m_BillTransfer.GetHeadNumber(11)rn StrCostObj = m_BillTransfer.GetHeadNumber(5)rn rn Set Rs = cn.Execute("Select FItemID from cbcostobj where FNumber = '" & StrCostObj & "'")rn rn LngCostObjID = Rs.Fields("FItemID")rn rnrn If LCase(Left(StrItemNumber, 1)) = "z" Or UCase(Left(StrItemNumber, 1)) = "Z" Thenrnrn '此SQL语句我在查询分析器里执行有4行记录,监视Rs时,只有第一条记录存在,后面三条都没有,请问是怎么回事? rn Set Rs = cn.Execute("Select FCostObjID From ICMO Where FTranType = 85") rn rn ReDim LngA(Rs.RecordCount) As Long '调试到此行报错为"<em>下标</em><em>越界</em>",请问怎么回事?rn rn Rs.MoveFirstrn For IntI = 1 To Rs.RecordCountrn LngA(IntI) = Rs.Fields("FCostObjID")rn If LngCostObjID = LngA(IntI) Thenrn MsgBox """成本对象""已被引用,本次操作取消", vbInformation, "金蝶提示"rn ReturnCode = -1rn Exit Subrn End Ifrn Rs.MoveNextrn Nextrn rn End Ifrn rn cn.Closern Exit SubrnErr:rn If Err.Number <> 0 Thenrn MsgBox Err.Description, vbCritical, "错误提示"rn End IfrnrnEnd Subrn[/code]
下标越界
sunslo="101,102,103"rnDim bb(ubound(sunslo)+1,2)rnfor i=0 to ubound(sunslo)rn j=j+1rn bb(j,2)=conn.execute("Select 名称 from Departmen where 编号='"&sunslo(i)&"'")(0)rnnextrnrnrn<em>下标</em><em>越界</em>: 'J'rnrnrn我只想得到<em>数组</em>rnbb(1,2)="名称1"rnbb(2,2)="名称2"rnbb(3,2)="名称3"
MultiTone生成工具下载
可以生成200Hz--4000Hz之间不同的频率的单频率声音,并且还可以合成最多3中频率的声音,可设置生成声音的时间和音量。 相关下载链接:[url=//download.csdn.net/download/usingnamespace/7071421?utm_source=bbsseo]//download.csdn.net/download/usingnamespace/7071421?utm_source=bbsseo[/url]
java用itext创建word模板下载
所用的包itext-2.1.7.jar,itext-rtf-2.1.7.jar 相关下载链接:[url=//download.csdn.net/download/u014717411/7193865?utm_source=bbsseo]//download.csdn.net/download/u014717411/7193865?utm_source=bbsseo[/url]
华阳导航仪改凯立德下载
H6五月份之后出厂华阳导航仪改凯立德(2015春季版).pdf ) 相关下载链接:[url=//download.csdn.net/download/mrshgq106/8710905?utm_source=bbsseo]//download.csdn.net/download/mrshgq106/8710905?utm_source=bbsseo[/url]
相关热词 c# 线程结束时执行 c# kb mb 图片 c# 替换第几位字符 c#项目决定成败 c# 与matlab c# xml缩进 c#传感器基础 c#操作wps c# md5使用方法 c# 引用父窗口的组件
我们是很有底线的