Numbering after using autofilter
Hi
After filtering select the rightmost column of the filtered range and run
this macro. Note it numbers rows in the row to the right of the selection
which could overwrite data
Sub Sonic()
Dim rngCell As Range
x=1
For Each rngCell In Selection
If rngCell.RowHeight < 0 Then
rngCell.Offset(, 1).Value = x
x = x + 1
End If
Next rngCell
End Sub
Mike
"Matt Pennington" wrote:
I have used autofilter to refine data now I need to number the rows - can
this be done automatically or does it need to be done after each filter is
selected?
|