我无法弄清楚为什么我会使用以下代码获得错误13 - 更具体地说是第8行(dStDev = Round(Application.StDev(rngGrainSummary),3))
Dim i As Long 'generic counter
Dim nColumns As Long 'number of grain sizes to plot
Dim iSeries As Series 'i-th series
Dim nSeries As Long 'total number of series
Dim rngIDNode As Range 'ID node of data worksheet
Dim rngGrainSummary As Range 'range including all current grain size data
Dim rngLimitNode As Range 'last specification cell of data worksheet
'find the stats by moving rngGrainSummary right incrementally
'rounding necessary due to constraint on string length of absolutely assigned y values
For i = 1 To nColumns
Set rngGrainSummary = rngGrainSummary.Offset(0, 1)
dMean(i) = Round(Application.Average(rngGrainSummary), 3)
dMax(i) = Round(Application.Max(rngGrainSummary), 3)
dMin(i) = Round(Application.Min(rngGrainSummary), 3)
dStDev = Round(Application.StDev(rngGrainSummary), 3)
dStDevAbove(i) = dMean(i) + dStDev
dStDevBelow(i) = dMean(i) - dStDev
Next
我不确定我还能添加什么对你们所有人都有帮助。请帮忙!
谢谢, 马特
答案 0 :(得分:0)
也许StDev返回错误值而不是Double
答案 1 :(得分:0)
rngGrainSummary需要至少两组数据才能解释。代码工作正常。