variablestypes长时间没有收到值?

所以,我想获得一段代码来设置一些基于variablesinput的坐标轴值,我认为这是一件非常简单的事情,但是…在下面的代码中,variablesiFlatMax只等于零,而不是值我告诉它在If语句中相等。 是什么赋予了? iCamType设置在另一个Sub()

 Private Sub PlotResults() Dim wbNew As Workbook Dim iRegSamples As Long Dim iColumnStart As Long Dim sXValues As String Dim sYValues As String Dim iToeMin, iToeMax, iFlatMin, iFlatMax As Long 'Set axes values based on cam type If iCamType = 93 Then iToeMin = -0.02 iToeMax = 0 iFlatMin = -0.015 iFlatMax = 0.025 Else iToeMin = -0.01 iToeMax = 0.01 iFlatMin = -0.01 iFlatMax = 0.015 End If 'More code End Sub 

更改:

 Dim iToeMin, iToeMax, iFlatMin, iFlatMax As Long 

至:

 Dim iToeMin as Double, iToeMax as Double, iFlatMin as Double, iFlatMax As Double