• Insert row and copy from cell above (2000/2003)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Insert row and copy from cell above (2000/2003)

    Author
    Topic
    #443324

    I have a small workbook attached that, I hope, explains what I need. I appreciate any help, thanks

    Viewing 0 reply threads
    Author
    Replies
    • #1069171

      1) Enter the formula

      =ROW()-4

      in cell A5 and fill down.

      2) Create the following macro and assign it to the button:

      Sub InsertARow()
      ActiveCell.EntireRow.Copy
      ActiveCell.Offset(1, 0).EntireRow.Insert
      Application.CutCopyMode = False
      End Sub

      • #1069183

        Thanks this is perfect.

        What does the -4 mean after Row()

        • #1069184

          The ROW() function returns the row number of the cell containing the formula.
          So in cell A5, ROW() returns 5. Since you want numbering to start with 1 in cell A5, we subtract 4 from the row number.
          The advantage of using ROW() is that it doesn’t matter if rows are inserted or deleted – the numbering will adjust automatically.

    Viewing 0 reply threads
    Reply To: Insert row and copy from cell above (2000/2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: