loop thru variables - Statistica Visual Basic - Statistica - Dell Community

loop thru variables

loop thru variables

This question is not answered

I am looking for example code. I need to loop thru all the variables in a spreadsheet and resize them.

All Replies
  • If you want to fit all vars (columns) width to content you can use Autofit command from Format - Variables menu. You can also set width for highlited columns using Format - Variables - Width command.

    Below is example code for setting format and column width:

    '#Language "WWB-COM"

    Sub Main
     Dim ark As Spreadsheet
     Set ark = ActiveSpreadsheet ' get active spreadsheet

     N_Vars=ark.NumberOfVariables 'get total number of vars

     For i_var=1 To N_Vars
      ark.VariableFormatString(i_var)="#.0" ' set variable format to one decimal place
      ark.VariableWidth(i_var)=1 'variable (column) width in spreadsheet, inches
     Next

    End Sub

     

  •  

    td is right. This is the easy way.

     

    Thanks td