Data source types: Essbase, Planning (ad hoc only), Financial Management (ad hoc only), Hyperion Enterprise (ad hoc only)
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.
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.
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