Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Numbering rows

  1. #1
    New Member
    Join Date
    Apr 2002
    Location
    Carole
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I want to number rows in my spreadsheet. How can I get the rows numbered, to appear automatically. Then if I instert a row it alters the numbering accodingly?

  2. #2
    New Member
    Join Date
    Mar 2002
    Location
    Australia
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Probably the easiest way is to use the ROW worksheet function, and then add or subtract a fixed number to get where you want. For example, if you wanted to start your numbers at row 10 with the number 1 you'd put the following in cell A10:

    =ROW(A10)-9

    Then copy this formula down until you have as many rows/numbers as you want.

    Penfold

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Huntington Beach, CA USA
    Posts
    327
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Carole,

    If you want to do it with a Commandbutton try
    this:

    Private Sub CommandButton_Click()
    Dim ColA As Range, rw As Range, n%
    Set ColA = Range("A6")
    Set rw As = ColA.EntireRow
    Do Until Application.WorksheetFunction.CountA
    _ (rw) = 0
    n = n + 1
    ColA.Value = n
    Set ColA = ColA.Offset(1, 0)
    Set rw = rw.Offset(1, 0)
    Loop
    End Sub

    The above code starts the numbering sequence
    in Col A, Row 6 You can modify as needed

    James



Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •