Spreadsheet.SetSize

This function sets the size of the spreadsheet.

Syntax Parameters Return Value
Sub Spreadsheet.SetSize( _
    CaseAmount As Integer, _
    VariableAmount As Integer)
  • CaseAmount [in]

Integer value specifying how many cases for the spreadsheet to have.

Type: Integer

  • VariableAmount [in]

Integer value specifying how many variables for the spreadsheet to have.

Type: Integer

This function does not return a value.

SVB Example

Getting the unique values from a spreadsheet:

Option Base 1
Sub Main
    Dim spr As Spreadsheet
    'assigns the active spreadsheet to the object spr
    Set spr = ActiveSpreadsheet
    Dim values() As Double
    'get the unique values and store them into the array values()
    'if the variable contains text labels they will be stored in the variable, labels
    spr.GetUniqueValues(1,False,values(),labels)
    Dim outputspr As Spreadsheet
    'create an output spreadsheet to display the returned values
    Set outputspr = Spreadsheets.New("Unique Values")
    'set the size of the spreadsheet
    outputspr.SetSize(UBound(values()),2)
    'place the data from the values array into variable 1 of the spreadsheet
    outputspr.VData(1) = values()
    'loop through the labels and place them in variable 2
    'if there were no text labels in the original spreadsheet,
    'variable 2 in the output spreadsheet will be blank
    For i = 1 To UBound(labels)
        outputspr.Value(i,2) = labels(i)
    Next i
    'display the output spreadsheet
    outputspr.Visible = True
End Sub