I am constantly adding rows to an Excel database, and I want to automatically number the records from 1 to x, x being last row. The code that follows works - but seems awkward because, since my data starts at row 6, I have to subtract 5 from the Row (function?). I thought that I could use .Count, but it didn't work. What is the command/function to count the total rows (not the row number) and then use it as a variable to auto fill to?
Sub colfill()
'
' colfill Macro
' Macro recorded 4/16/2002 by Preferred Customer
'
Range("a6") = 1
RowCount = Range("b6").End(xlDown).Row - 5
'
Application.Goto Reference:="R6C1"
Selection.DataSeries Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, _
Step:=1, Stop:=RowCount, Trend:=False
End Sub
Thanks, SJK
Sub colfill()
'
' colfill Macro
' Macro recorded 4/16/2002 by Preferred Customer
'
Range("a6") = 1
RowCount = Range("b6").End(xlDown).Row - 5
'
Application.Goto Reference:="R6C1"
Selection.DataSeries Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, _
Step:=1, Stop:=RowCount, Trend:=False
End Sub
Thanks, SJK