Spreadsheet.SelectedCaseWithWeights

This function returns case using selection conditions and weighting variable.

Syntax Parameters Return Value
Sub CriteriaOptions.Add( _
    Name As Variant, _
    Value As Variant)
  • CaseNo [in]

The case.

Type: Integer

  • Cases [out]

Array of doubles used to store to returned case.

Type: Double()

  • Selected [out]

Boolean variable passed by reference which indicates whether the specified case is being included or excluded via case selections.

Type: Boolean

  • CaseWeights [out]

Boolean variable passed by reference which indicates whether or not the specified case is being weighted.

Type: Boolean

  • Weight [out]

Double variable passed by reference which indicates the value of the weight variable being applied to the specified case.

Type: Double

  • VarNo [out]

Integer variable passed by reference which indicates the weight variable.

Type: Integer

This function does not return a value.

SVB Example

Reviewing a case's weighting and case selection:

Option Explicit
Sub Main
    Dim spr As Spreadsheet
    'assigns the active spreadsheet to the object spr
    Set spr = ActiveSpreadsheet
    Dim CaseData() As Double
    'CaseData will contain the data of case 1
    Dim IsItSelected As Boolean, IsItWeighed As Boolean
    Dim VarNo As Integer, VarWeight As Double
    Dim WeightVar As Long
    spr.SelectedCaseWithWeights(1,CaseData(),IsItSelected, _
    IsItWeighed,VarWeight,WeightVar)
    MsgBox "Case 1" & _
        vbCrLf & "Weighting = " & Str(IsItWeighed) & _
        vbCrLf & "Case Selected = " & Str(IsItSelected) & _
        vbCrLf & "Weight Variable is " & Str(WeightVar) & _
        vbCrLf & "The Weight Value is " & Str(VarWeight)
End Sub