Count Property Example

This example sets variables to the number of columns and the number of rows in the visible range on the active worksheet.

Set vr = Spreadsheet1.ActiveSheet.VisibleRange
cc = vr.Columns.Count
rc = vr.Rows.Count