VBA,有效的代码>集成输入框>溢出错误

时间:2018-09-20 08:18:50

标签: overflow inputbox

以下代码可以正常工作。一旦我替换了最小和最大 使用两个输入框时,发生溢出错误。 我已经搜索了很长时间,但是没有找到解决方法。

有人有主意吗?

Sub test() '#no programmer...
Dim datum, min, max, wert, i, l As Double
Dim zahl, inc, easa, ca, sea, bpp As Double
inc = 0
l = 0
Application.ScreenUpdating = False
'-------------------------------------------------
'determination min max
'min = 20180000
'max = 20181010
min = InputBox("Lower Date for data range. Insert as shown: 01.05.2018 > 20180501")
max = InputBox("Upper Date for data range. Insert as shown: 01.05.2018 > 20180501")
'-------------------------------------------------
Range("G4").Select
line6:
inc = 0
easa = 0
ca = 0
sea = 0
bpp = 0
i = 0
'-------------------------------------------------
'determine if stops or not
Selection.Offset(0, -5).Select
If ActiveCell.Value = vbNullString Then
    GoTo line7
Else
End If
'-------------------------------------------------
'some if stuff
'-------------------------------------------------------------
'average
wert = (inc + easa + ca + sea + bpp) / i
'------------------------------------------------------------
Worksheets("Master").Activate
Range("G4").Select
Selection.Offset(l, 1).Select
ActiveCell = wert
GoTo line6
'-------------------------------------------------------------
line7:
Application.ScreenUpdating = True
End Sub

0 个答案:

没有答案