HypKeepOnly

Data source types: Essbase, Planning (ad hoc only), Financial Management (ad hoc only), Hyperion Enterprise (ad hoc only)

Description

HypKeepOnly() retains only the selected member(s) in the sheet and removes unselected members.

The selection must be limited to member cells only, not data cells.

Syntax

HypKeepOnly(vtSheetName, vtSelection)

ByVal vtSheetName As Variant

ByVal vtSelection As Variant

Parameters

vtSheetName: For future use. Currently the active sheet is used.

vtSelection: Range object which refers to the member(s) that will be kept. If selection is Null or Empty, the active cell is used.

Return Value

Returns 0 if successful; otherwise, returns the appropriate error code.

Example

Declare Function HypKeepOnly Lib "HsAddin" (ByVal vtSheetName As Variant, ByVal vtSelection As Variant) As Long

Sub KOnly()
' Keep Only on one member name
   X=HypKeepOnly(Empty, RANGE("D2"))
   If X = 0 Then
      MsgBox("Keep Only successful.")
   Else
      MsgBox("Keep Only failed." + X)
   End If
' Keep Only on two member names
   X=HypKeepOnly(Empty, RANGE("D2:A5"))
   If X = 0 Then
      MsgBox("Keep Only successful.")
   Else
      MsgBox("Keep Only failed." + X)
   End If
End Sub