Here is some code I use to fill a list of numbers
Sub AutoNumberFill()
Dim x As Long
Dim rn As Long
Dim cn As String
cn = InputBox("Which Column to fill?")
rn = InputBox("How many rows to fill?")
sn = InputBox("Which row to start fill?")
Application.ScreenUpdating = False
Application.StatusBar = "Macro Running"
x = 1
Range(cn & sn).Select
Do Until ActiveCell.Row = rn + sn
If ActiveCell.EntireRow.Hidden = False Then
ActiveCell.Value = x
x = x + 1
End If
ActiveCell.Offset(1).Select
Loop
Application.ScreenUpdating = True
Application.StatusBar = "Completed"
End Sub
Bookmarks