Spreadsheet.SetSize
This function sets the size of the spreadsheet.
SVB Example
Getting the unique values from a spreadsheet:
Option Base 1 Sub Main Dim spr As Spreadsheet 'assigns the active spreadsheet to the object spr Set spr = ActiveSpreadsheet Dim values() As Double 'get the unique values and store them into the array values() 'if the variable contains text labels they will be stored in the variable, labels spr.GetUniqueValues(1,False,values(),labels) Dim outputspr As Spreadsheet 'create an output spreadsheet to display the returned values Set outputspr = Spreadsheets.New("Unique Values") 'set the size of the spreadsheet outputspr.SetSize(UBound(values()),2) 'place the data from the values array into variable 1 of the spreadsheet outputspr.VData(1) = values() 'loop through the labels and place them in variable 2 'if there were no text labels in the original spreadsheet, 'variable 2 in the output spreadsheet will be blank For i = 1 To UBound(labels) outputspr.Value(i,2) = labels(i) Next i 'display the output spreadsheet outputspr.Visible = True End Sub
Copyright © 2020. Cloud Software Group, Inc. All Rights Reserved.