I am looking for example code. I need to loop thru all the variables in a spreadsheet and resize them.
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:
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
td is right. This is the easy way.