Spreadsheet.AddVariables
This function adds a specified number of variables to the spreadsheet.
| Syntax | Parameters | Return Value |
|---|---|---|
Sub Spreadsheet.AddVariables( _
Name As String, _
After As Integer, _
Optional HowMany As Variant, _
Optional Type As Variant, _
Optional Len As Variant, _
Optional MissingData As Variant, _
Optional Format As Variant, _
Optional LongName As Variant)
|
The name of the new variable(s). Type: String
Long value specifying after which variable the new variables should be added to. Type: Integer
How many variables are to be added. This parameter defaults to 1. Type: Variant
Integer value specify the data type of the variable. The following constants can be used as arguments for this parameter: scDouble, scByte, scInteger, or scText. This parameter defaults to scDouble. Type: Variant
The maximum text length of the variable (if its data type is text). Type: Variant
The value to be associated with missing data. Type: Variant
The format of the variable. This parameter defaults to an empty string. Type: Variant
The long name or function of the variable. This parameter defaults to an empty string. Type: Variant |
This function does not return a value. |
SVB Example
Adding cases and variables to a spreadsheet:
Option Base 1
Option Explicit
Sub Main
Dim spr As Spreadsheet
'assigns the active spreadsheet to the object spr
Set spr = ActiveSpreadsheet
'adds 4 cases to the spreadsheet after case 10
spr.AddCases(10,4)
'adds 4 variables to the spreadsheet after variable 10
spr.AddVariables("New Variables", 10,4, scText, 20)
End Sub