+ Reply to Thread
Results 1 to 2 of 2

Code to paste data into first empty cell in range

  1. #1
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Code to paste data into first empty cell in range

    The code below currently pastes data into all empty cells in range (LastRowPaste to PasteRange). How can I edit it to just paste into the first empty cell in range?

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor Cerbera's Avatar
    Join Date
    07-06-2010
    Location
    Rotorua, New Zealand
    MS-Off Ver
    Excel 2007, 2013, 2016 & 365
    Posts
    137

    Re: Code to paste data into first empty cell in range

    Hi Nitefox,

    You may be able to make use of the below code - I've hardcoded some ranges for the purpose of testing (I can't see the rest of your code to know where LastRowPaste and PasteRange are populated).

    Please Login or Register  to view this content.
    This code checks if there is an empty cell (there may not be an empty cell!) within the "A5:A12" range and if so it populates the first cell with the word test.

    If you want to populate cells in adjacent columns just use offset to insert values, e.g.

    Please Login or Register  to view this content.
    Will populate the cell to right with "cell to the right".

    Hope this helps.

+ 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. Replies: 0
    Last Post: 03-20-2014, 11:51 AM
  2. paste into next empty cell in a range
    By ratdogexcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-01-2013, 11:22 AM
  3. [SOLVED] Paste a value in the next empty cell for a defined range
    By aadeshgandhi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-13-2013, 08:53 PM
  4. Find next empty cell in range and paste
    By Friday in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-16-2011, 12:51 AM
  5. Cannot copy/paste save data if range value is empty
    By Christeen in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-12-2011, 04:04 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