Handy Excel Macros
(Microsoft Excel 2003)
 

Numbering down column macro - (particularly usefull when in autofilter)

(Automatic numbering down the page does not always work when you have filtered in the  autofilter)

 

note: This numbering macro sends you back to the top of the numbers as well

Sub Numbering()

'Written by Mark van Zoest  - Handy Excel macros website

Dim iCount As Integer

Dim i As Integer

Dim itarget As Integer

Dim start As Integer

 

iCount = Selection.Rows.Count

 

itarget = InputBox("Default start at 1)", "Highlight a range of cells and enter start number", 1)

 

start = 0

Set origonal = ActiveCell

For i = 1 To iCount

ActiveCell.Value = itarget

ActiveCell.Offset(1, 0).Select

itarget = itarget + 1

start = start + 1

Next i

 

ActiveCell.Offset(-start, 0).Select

End Sub

Steps when running the macro:

1/ highlight all the cells down the column that you want to be numbered

2/ Run macro

triangle.gif
Back to Index Page
   US $6
(Includes PayPal)