Ranges

Maintains a list of Range objects in a report.

Discussion

Collections are generic objects that group or list other types of objects. You can group the Range objects in an Exception object into a Ranges collection. Use a Ranges collection to operate on the entire group of Range objects at once rather than one at a time.

Name

Description

Add Method (Ranges)

Adds a Range object to the Ranges collection.

Item Method

Returns a Range object from the Ranges collection.

Remove Method

Removes all Range objects from the Exception object.

Name

Description

Application Property

Returns the Application object.

Count Property

Returns the number of Range objects in the collection.

MaximumNumberOfRanges Property

Returns the maximum number of Range objects definable for an Exception object.

Example

This example shows how to return a Ranges collection and returns the maximum number of Range objects that you can define for the Exception object.

Sub Main()
   Dim objPPRep As Object
   Dim objPPRange As Object
   Set objPPRep = GetObject("C:\Cubes and Reports\Exception.ppr")
   objPPRep.Visible = True
   Set objPPRange = objPPRep.Exceptions.item(1).Ranges
   MsgBox "The maximum number of ranges: " _
      &objPPRange.MaximumNumberOfRanges
   Set objPPRange = Nothing
   Set objPPRep = Nothing
End Sub

Related Topics