Spreadsheet.VariableMissingData

This property returns/sets the missing data value for the specified variable.

Syntax Parameters Return Value
Property Spreadsheet.VariableMissingData( _
    VarNo As Integer) As Double
VarNo [in]

The variable index.

Type: Integer

Double

SVB Example

Setting cells to missing data:

Option Base 1
Option Explicit
Sub Main
    Dim spr As Spreadsheet
    'assigns the active spreadsheet to the object spr
    Set spr = ActiveSpreadsheet
    'set all the cells in variable 2 to MD
    Dim i As Integer
    For i = 1 To spr.NumberOfCases
        spr.Value(i,2) = spr.VariableMissingData(2)
    Next i
End Sub