' Description Populates a variable with the value labels of another ' David Marso re:value labels 02/18/1998 Option Explicit Sub Main Dim objSPSSInfo As ISpssInfo,ValueLabels() Dim varwithlabels As String, varwithoutlabels As String Dim NumVars As Long,I As Long,J As Long, NumLabels As Long Dim strSyntax As String 'Substitute your variables here (or build a dialog). varwithlabels = "a" :varwithoutlabels="b" Set objSPSSInfo = objSpssApp.SpssInfo NumVars=objSPSSInfo.NumVariables-1 For I=0 To NumVars If objSPSSInfo.VariableAt(I)=varwithlabels Then NumLabels= objSPSSInfo.NumberOfValueLabels(I)-1 strSyntax= "VALUE LABELS " & varwithoutlabels & " " ReDim ValueLabels(1,NumLabels) For J=0 To NumLabels With objSPSSInfo strSyntax =strSyntax & .ValueAt(I,J) & " " & Chr$(34) & .ValueLabelAt(I,J) & Chr$(34) & " " End With Next J objSpssApp.ExecuteCommands(strSyntax,False) Exit For End If Next I End Sub