+ Reply to Thread
Results 1 to 8 of 8

Paste in next empty cell

  1. #1
    Registered User
    Join Date
    07-25-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013 64bit
    Posts
    29

    Paste in next empty cell

    Hi all.

    So far I have this code, to copy the value from sheet1 B4 to sheet2 A17 and Sheet3 A17.

    Please Login or Register  to view this content.
    Now I wanna make sure, that when I put a new value into sheet1 b4, it pastes the values into the next empty celly in column A of sheet 2 and 3.

    I tried the following with help from google (first only for pasting into sheet2, so that it won't become too complicated for a start)

    Please Login or Register  to view this content.
    I do however get a "object doesn't support this property or method"-error, once sheet2 A17 has a value in it.

    Can you guys help me?

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Paste in next empty cell

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-25-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013 64bit
    Posts
    29

    Re: Paste in next empty cell

    I just found the mistake myself.. i had to use PasteSpecial in the last command instead of Paste.

    Your command looks easier however, what does the "End(3) (2)" stand for though?

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Paste in next empty cell

    It points too the last empty cell in Column A of both sheets.

    The (3) is an xl constant for (xlUp)
    The (2) is an offset command. The last used cell would be (1). One cell below would be (2) and so on ....
    It would be equal to Offset(1) normally used.

  5. #5
    Registered User
    Join Date
    07-25-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013 64bit
    Posts
    29

    Re: Paste in next empty cell

    Thank you. But how does the programme know to start at A17?

    I mean your code works perfectly fine, but I wanna duplicate it for another column, so I need to know just how exactly it works.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Paste in next empty cell

    It doesn't it looks for the next empty cell. Is there data in A17?

  7. #7
    Registered User
    Join Date
    07-25-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013 64bit
    Posts
    29

    Re: Paste in next empty cell

    there is data in a16 but no data in a few cells before that.

    I want it to start in a17 though (and it does without my stating it explicitly)

    edit: well i guess it looks for the next empty cell from the bottom of the page up to the top.

    Thank you for your help!
    Last edited by Ventoux; 09-17-2013 at 09:06 AM.

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Paste in next empty cell

    If there's always data in A16 it will choose A17 as the next empty cell and continue to copy down from there. You're welcome. Glad to help out and thanks for the feedback and the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Paste to empty cell
    By Dan23cd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-22-2013, 10:16 PM
  2. Paste into specified cell if empty, if not go to next empty in row
    By Dan23cd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-19-2013, 02:27 PM
  3. paste value to the next empty cell on the right
    By easternlethal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2012, 09:13 AM
  4. Copy values from cell in active row, paste in first empty cell in spesified column.
    By Test123Test in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-19-2012, 05:20 PM
  5. paste to next empty cell macro
    By ntie0212 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-07-2011, 10:35 AM

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