Spreadsheet.SubsetSplitSpreadsheet
This function creates two new spreadsheets by splitting the current spreadsheet using a probability value.
Syntax | Parameters | Return Value |
---|---|---|
Sub Spreadsheet.SubsetSplitSpreadsheet( _ Variables As Variant, _ selectionIncludeExpression As String, _ selectionIncludeList As String, _ selectionExcludeExpression As String, _ selectionExcludeList As String, _ dProb As Double, _ bQuickRand As Boolean, _ bUseSpreadsheetSelCond As Boolean, _ bUseCaseWiseMDDeletion As Boolean, _ ByRef LeftSpreadsheet As Spreadsheet, _ ByRef RightSpreadsheet As Spreadsheet) |
The variables to be included in the creation of the subsets. Type: Variant String value specifying a Selection condition include expression. Type: String String value specifying a Selection condition Include list. Type: String String value specifying a Selection condition Exclude expression. Type: String String value specifying a Selection condition Exclude list. Type: String The approximate percentage of cases to be placed into the first spreadsheet. Type: Double Whether or not to use quick random sampling. Type: Boolean Whether or not to use the spreadsheets selection conditions. Type: Boolean The use of Case Wise Missing Data Deletion. Type: Boolean Spreadsheet object where the specified percentage of cases will be stored. Type: Spreadsheet Spreadsheet object where all remaining cases will be stored. Type: Spreadsheet |
This function does not return a value. |
SVB Example
Splitting a spreadsheet via random sampling:
Option Base 1 Option Explicit Sub Main Dim spr As Spreadsheet 'assigns the active spreadsheet to the object spr Set spr = ActiveSpreadsheet Dim Lftspr As Spreadsheet Dim Rgtspr As Spreadsheet 'splits the spreadsheet spr using all of the variables, with the first spreadsheet 'containing approximately 50% of the cases, using quick random sampling 'the results of the split are placed into the spreadsheet objects Lftspr and Rgtspr spr.SubsetSplitSpreadsheet("*","","","","",.50,True,False,False,Lftspr,Rgtspr) 'display the Lftspr spreadsheet Lftspr.Visible = True 'display the Rgtspr spreadsheet Rgtspr.Visible = True End Sub