質問

I'm unable to work out why I'm getting an Error 13 with the following code - more specifically at line 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

I'm not sure what else I can add that will be of any help to you all. Please help!

Thanks, Matt

役に立ちましたか?

解決 2

rngGrainSummary required AT LEAST two sets of data to interpret. Code works fine.

他のヒント

Perhaps StDev is returning an error value rather than a Double

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top