Thread: numbering cells
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default numbering cells

Running this tiny macro will number rows 1 thro 1000 in column A:

Sub NumberThem()
Set r = Range("A1:A1000")
r.Formula = "=row()"
End Sub

Make the obvious adjustments to change the column or the last row.

Macros are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To use the macro from the normal Excel window:

1. ALT-F8
2. Select the macro
3. Touch Run



To remove the macro:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Gary''s Student - gsnu200909


"Soth" wrote:


Hi-

I have over 200,000 lines and I'd like to numbering each cell 123...etc.
The problem is some cells are blank and I can't seem to do as much auto
refill and it just time consuming to drag cell all the way to 200K line. So
i'm wondering if there is a quickest way to numbering cell from 1 through
200000

Thanks
Soth