• Fill macro (Excel 2000)

    Author
    Topic
    #385088

    Hi all,

    Wonder if someone could give me a hand on this. I want to copy about 1000 rows of cells in column A with the data from the cell above, so A2 will copy A1 and repeat this for 1000 rows. What is the easiest way of doing this?

    Thanks,
    Kingming

    Viewing 0 reply threads
    Author
    Replies
    • #662968

      Try

      Range(“A1:A1000”).FillDown

      if you are using VBA, otherwsie copy and paste.

      Andrew

      • #662996

        Thanks for your help Andrew.

      • #663001

        Hi Andrew,

        Can it be written so that it will only copy the above cell if the cell is empty?

        Thank-you for any help you can give me.

        • #663005

          Your spec is ambiguous, so here are two macros, depending on what you really want to do. HTH –Sam

          Option Explicit
          
          Sub copyA1()
          Dim c As Range
              For Each c In [A2:A1000]
                  If IsEmpty© Then _
                      [A1].Copy c
              Next c
          End Sub
          
          Sub copyAbove()
          Dim c As Range
              For Each c In [A2:A1000]
                  If IsEmpty© Then _
                      c.Offset(-1).Copy c
              Next c
          End Sub
    Viewing 0 reply threads
    Reply To: Fill macro (Excel 2000)

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

    Your information: