我有一個程序來解決包裝問題3D。當我只有100行我的代碼工作數據的運行程序,但是當我用我的所有數據我有一個錯誤:Excel VBA錯誤溢出
Run-time error '6':
Overflow
這裏是我的代碼:
If rotationtype = 2 Then
Do While Worksheets(6).Cells(xrow, xcolumn).Value <> ""
' 0,1 > inputan
If Worksheets(6).Cells(xrow, xcolumn).Offset(0, 1).Value > Worksheets(6).Cells(xrow, xcolumn).Value Then
Worksheets(6).Cells(xrow, xcolumn).Offset(0, 3).Value = Worksheets(6).Cells(xrow, xcolumn).Offset(0, 1).Value
Worksheets(6).Cells(xrow, xcolumn).Offset(0, 4).Value = Worksheets(6).Cells(xrow, xcolumn).Value
Worksheets(6).Cells(xrow, xcolumn).Offset(0, 5).Value = Worksheets(6).Cells(xrow, xcolumn).Offset(0, 2).Value
Else ' 0,1 < inputan
Worksheets(6).Cells(xrow, xcolumn).Offset(0, 3).Value = Worksheets(6).Cells(xrow, xcolumn).Value
Worksheets(6).Cells(xrow, xcolumn).Offset(0, 4).Value = Worksheets(6).Cells(xrow, xcolumn).Offset(0, 1).Value
Worksheets(6).Cells(xrow, xcolumn).Offset(0, 5).Value = Worksheets(6).Cells(xrow, xcolumn).Offset(0, 2).Value
End If
xrow = xrow + 1
Loop
Toplamkutusayisi = xrow - 2
xrow = 2
Else
我有49606行的數據:
如何ç我避免得到這個錯誤?
,你可以單擊「調試」時出現錯誤,然後通過輸入查詢xrow的價值「xrow?」即時窗口(Ctrl + G) – NiH