Try this macro. It inserts a new column A, then in that column numbers only
the visible rows.
Sub NumberVisibleRows()
Dim x As Long, Rng As Range
x = 0
'Insert a new column A on the active sheet.
Range("A1").Select
Selection.EntireColumn.Insert
'Select the new column A.
Columns("A:A").Select
'Walk down column A.
For Each Rng In Selection
'If row is not hidden, increment the
'counter and number the row.
If Rng.EntireRow.Hidden = False Then
x = x + 1
Rng.Value = x
End If
'Move to the next row.
Next Rng
End Sub
Hope this helps,
Hutch