我不能工作的原因我發現了一個錯誤13用下面的代碼 - 更具體地在管線8(DSTDEV = ROUND(Application.StDev(rngGrainSummary),3))錯誤13類型不匹配
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
我不確定我還可以添加哪些東西,對您的所有人都有幫助。請幫忙!
謝謝, 馬特
_我不確定我還可以添加什麼......_您可以包含變量的定義。你的錯誤可能是因爲你沒有使用'dStDev(i)',很難說沒有定義。 –
'rngGrainSummary'的初始引用是什麼?如果它是單個單元格,那麼上面的代碼也會引用一個單元格,並且'stdev'將返回一個錯誤。 – Ioannis
這很令人困惑,因爲我們有許多s/sheet使用相同的代碼沒有問題。很奇怪。 – Matteous