Data source types: Essbase, Planning (ad hoc only), Financial Management (ad hoc only), Hyperion Enterprise (ad hoc only)
HypRemoveOnly() removes only the selected member(s) in the sheet and retains unselected members in the selected dimension.
Selection should include only member cells, not data cells.
vtSheetName: For future use. Currently the active sheet is used.
vtSelection: Range object which refers to the member(s) that will be removed. If selection is Null or Empty, the active cell is used.
Declare Function HypRemoveOnly Lib "HsAddin" (ByVal vtSheetName As Variant, ByVal vtSelection As Variant) As Long
Sub ROnly()
' Remove Only on one member name
X=HypRemoveOnly(Empty, RANGE("D2"))
If X = 0 Then
MsgBox("Remove Only successful.")
Else
MsgBox("Remove Only failed." + X)
End If
' Remove Only on two member names
X=HypRemoveOnly(Empty, RANGE("D2, A5"))
If X = 0 Then
MsgBox("Remove Only successful.")
Else
MsgBox("Remove Only failed." + X)
End If
End Sub