Removes only the selected member(s) in the worksheet and retains unselected members in the selected dimension.
EssVRemoveOnly(sheetName, range, selection) ByVal sheetName As Variant ByVal range As Variant ByVal selection As Variant
Text name of the worksheet to operate on. sheetName is of the form "[Book.xls]Sheet". If sheetName is Null or Empty, the active worksheet is used.
Range object which refers to the data to be used. The range must include the member names and data cells. If range is Null or Empty, the whole worksheet is used.
Range object which refers to the member(s) that are removed. If selection is Null or Empty, the active cell is used.
Returns 0 if successful. A negative number indicates a local failure (see VBA Return Values). A return value greater than zero indicates a failure on the server.
Declare Function EssVRemoveOnly Lib "ESSEXCLN.XLL" (ByVal sheetName As Variant, ByVal range As Variant, ByVal selection As Variant) As Long Sub ROnly() ' Remove Only on one member name X=EssVRemoveOnly("[Book2.xls]Sheet1", RANGE("A1:G52"), 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=EssVRemoveOnly("[Book2.xls]Sheet1", RANGE("A1:G52"), RANGE("D2, A5")) If X = 0 Then MsgBox("Remove Only successful.") Else MsgBox("Remove Only failed." + X) End If End Sub