+ Reply to Thread
Results 1 to 2 of 2

Copy Cell from Row Above

  1. #1
    Registered User
    Join Date
    07-11-2005
    Posts
    30

    Copy Cell from Row Above

    s there a command that will copy the CELL from the row above it -- i.e. copy A1 to copy A2
    . I'm thinking of selection.filldown but i don't know how to adjust the fields so that it only looks 1 row above it

    i'm planing on using this in a loop for a selection that will scan a series of rows and if there is a certain criteria i want it to copy the cell from the row above

    THANKS

    Sub fill_in_the_blanks()

    Application.ScreenUpdating = False
    Columns("A:A").Select
    For Each cell In Selection
    If cell = "" Then
    copy the cell above it and paste the cell from above to here
    End If
    Next cell
    Application.ScreenUpdating = True

    End Sub

  2. #2
    Mike Punko
    Guest

    RE: Copy Cell from Row Above

    Why not just use teh IF Function?

    A3=IF(A2>0,A2,A1)

    A2>0 This is you rule for a True or False
    A2 Is returned if True
    A1 Is returned if False

    A B
    1 1 2
    2 0 2
    3 1



    "narutard" wrote:

    >
    > s there a command that will copy the CELL from the row above it -- i.e.
    > copy A1 to copy A2
    > . I'm thinking of selection.filldown but i don't know how to adjust the
    > fields so that it only looks 1 row above it
    >
    > i'm planing on using this in a loop for a selection that will scan a
    > series of rows and if there is a certain criteria i want it to copy the
    > cell from the row above
    >
    > THANKS
    >
    > Sub fill_in_the_blanks()
    >
    > Application.ScreenUpdating = False
    > Columns("A:A").Select
    > For Each cell In Selection
    > If cell = "" Then
    > *copy the cell above it and paste the cell from above to here*
    > End If
    > Next cell
    > Application.ScreenUpdating = True
    >
    > End Sub
    >
    >
    > --
    > narutard
    > ------------------------------------------------------------------------
    > narutard's Profile: http://www.excelforum.com/member.php...o&userid=25111
    > View this thread: http://www.excelforum.com/showthread...hreadid=466778
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1