+ Reply to Thread
Results 1 to 5 of 5

Paste in next blank row

  1. #1
    Registered User
    Join Date
    11-12-2014
    Location
    Newcastle, England
    MS-Off Ver
    2010
    Posts
    54

    Paste in next blank row

    Hi guys,

    I can't quite fathom out how to paste the results of a stage 2 query in the next blank row after the results of the stage 1 query have been pasted.

    File and code attached. The offending line of code is marked with **

    Many Thanks in advance.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Paste in next blank row

    Hi monkeypants,

    Here is the code that finds the first blank in a column:

    Dim LastRow as Double

    LastRow = Cells(Rows.Count,"A").End(xlUp).Row + 1

    The line above uses Rows.Count which is at the bottom of the worksheet. Do a Control down arrow a bunch of times and you will get there. Older Excel and Newer Excel have a different max number of Rows.
    Then the "A" tell which column you want to look for that last piece of data.
    The End(xlUp) is like pressing a Control Up Arrow when at the bottom. This will stop when it hits the first non blank cell. One row below this is the first blank row. That is the +1 part.

    Hope this helps and is what you were looking for.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    11-12-2014
    Location
    Newcastle, England
    MS-Off Ver
    2010
    Posts
    54

    Re: Paste in next blank row

    Thanks Marvin, that worked very well.

    One slight problem which is undoubtedly due to the way the code is written.
    On the Expenses tab, there are no entries in August 2015, but when selecting 1/8/15 in cell G1 on the total tab, it appends all of the entries from the expenses tab.

    An updated version of the file is attached.

  4. #4
    Registered User
    Join Date
    11-12-2014
    Location
    Newcastle, England
    MS-Off Ver
    2010
    Posts
    54

    Re: Paste in next blank row

    File attached this time...

  5. #5
    Registered User
    Join Date
    11-12-2014
    Location
    Newcastle, England
    MS-Off Ver
    2010
    Posts
    54

    Re: Paste in next blank row

    I resolved it by inserting an error handler into the code.

+ 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. VBA: Copy non-blank and paste to separate sheet ONLY blank cells (running list)
    By brolsen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2014, 03:34 PM
  2. Replies: 6
    Last Post: 08-14-2013, 01:24 AM
  3. [SOLVED] Paste to next blank row?
    By adste89 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-02-2013, 12:36 PM
  4. Button to cut/paste to blank row in new sheet and delete blank row in old sheet
    By drewship in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-08-2013, 05:18 PM
  5. Copy till first non-blank row and paste on first blank row
    By patsdavixen in forum Excel General
    Replies: 2
    Last Post: 03-02-2013, 10:09 PM
  6. [SOLVED] Paste into Next Blank Row
    By cfherd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-07-2012, 10:27 AM
  7. Paste in new blank row
    By Erik88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2011, 04:06 PM

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