ColumnWidth Property Example

This example sets the formula, column width, and number format for all the cells in the range A1:F10 on the active worksheet.

Set rg = Spreadsheet1.ActiveSheet.Range("a1:f10")
rg.Formula = "=rand()"
rg.ColumnWidth = 100
rg.NumberFormat = "#.###"