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)
|
The case. Type: Integer
Array of doubles used to store to returned case. Type: Double()
Boolean variable passed by reference which indicates whether the specified case is being included or excluded via case selections. Type: Boolean
Boolean variable passed by reference which indicates whether or not the specified case is being weighted. Type: Boolean
Double variable passed by reference which indicates the value of the weight variable being applied to the specified case. Type: Double
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