- 需要在2D数组(行和列)中找到最大字符串长度,以计算最小列宽。
- 如何根据变量值定义固定的数组大小(可以从工具返回)?
'So now here we have:
Dim arr()
Dim nRowsMax,nColumnmax
nRows = oTool.MaxRowCount
nColumns = oTool.MaxColCount
ReDim arr(nRows,nColumns)
Dim sCellValue : sCellValue = oTool.Value(nRow,nCol)
Dim nCellWidth = Len(sCellValue)
Dim nRow,nCol
For nRow = 1 To nRows
For nColumn = 1 To nColumns
If arr(nRow,nCol) < nmin Then nmin = arr(nRow,nCol)
If arr(nRow,nCol) > nmax Then nmax = arr(nRow,nCol)
Next ' Column
Next ' Row