Statistics [WksRange]
The Statistics method calculates statistics on all the columns in the range. Returns a WksStatistics object.
Syntax
object.Statistics( Sample, Header, Flags )
Parameter | Type | Default | Description |
Sample | Boolean | False | optional, this specifies whether the data represent a statistical sample or the complete set of all possible members of a population. If set to 'True', the data represent a sample. |
Header | Boolean | False | optional, this specifies whether the first row of the selection contains descriptive labels. If this is set to 'True', the label appears at the top of the statistics report for each column. |
Flags | Long | 0 | This specifies the statistics to compute, the WksStats enumeration can be used for this parameter. |
InclusionRange | wksInclusionRange | wksIncludeAll | optional, this is the range of values to include when calculating the statistic. |
RangeValue1 | Double | 0 | optional, this is the Minimum value for the InclusionRange types wksIncludeInsideRange or wksIncludeOutsideRange. This is the ignored value in wksIncludeAllExceptSingleValue. This value is not used for wksIncludeAll. |
RangeValue2 | Double | 0 | optional, this is the Maximum value for the InclusionRange types wksIncludeInsideRange or wksIncludeOutsideRange. This is the tolerance value in wksIncludeAllExceptSingleValue. This value is not used for wksIncludeAll. |
Remarks
See Specifying Cell Coordinates for more information on selecting cells.
Example 1
This example demonstrates how to print the mean of column A.
Set stats = WksRange. Statistics (True,False,wksStatsMean)
Debug.Print stats.Mean
Example 2
This example demonstrates how to calculate all statistics for column inside the range 30-50.
Set stats = WksRange. Statistics (True,False,wksStatsAll,wksIncludeInsideRange, 30, 50)
Example 3
This example demonstrates how to calculate all statistics for column outside the range 30-50.
Set stats = WksRange. Statistics (True,False,wksStatsAll,wksIncludeOutsideRange, 30, 50)
Used by: WksRange object