Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Apr 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Fill macro (Excel 2000)

    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

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Fill macro (Excel 2000)

    Try

    Range("A1:A1000").FillDown

    if you are using VBA, otherwsie copy and paste.

    Andrew

  3. #3
    Lounger
    Join Date
    Apr 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Fill macro (Excel 2000)

    Thanks for your help Andrew.

  4. #4
    Lounger
    Join Date
    Apr 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Fill macro (Excel 2000)

    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.

  5. #5
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Fill macro (Excel 2000)

    Your spec is ambiguous, so here are two macros, depending on what you really want to do. HTH --Sam
    <pre>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</pre>

    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  6. #6
    Lounger
    Join Date
    Apr 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Fill macro (Excel 2000)

    Thanks!

Posting Permissions

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