RowNumbers Property

Microsoft Excel Visual Basic

True if row numbers are added as the first column of the specified query table. Read/write Boolean.

Remarks

Setting this property to True doesn’t immediately cause row numbers to appear. The row numbers appear the next time the query table is refreshed, and they’re reconfigured every time the query table is refreshed.

Example

This example adds row numbers and field names to the query table.

With Worksheets(1).QueryTables("ExternalData1")
    .RowNumbers = True
    .FieldNames = True
    .Refresh
End With