+ Reply to Thread
Results 1 to 5 of 5

Find Last Row & Paste

  1. #1
    Forum Contributor
    Join Date
    06-06-2008
    Location
    Manchester
    MS-Off Ver
    MS Office 2003
    Posts
    161

    Find Last Row & Paste

    I have this code which works great as it will copy from another workbook and paste the data into the relevant Cell.

    How is it possible to paste a data set if that cell is not blank, but look for the next blank cell and paste.

    eg Cell C5 is not blank and each Cell till C15 is also not blank but Cell C16 is blank I want to paste there. How can that be done?

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    Re: Find Last Row & Paste

    Hi
    try altering these 2 lines of code
    Please Login or Register  to view this content.
    Ravi

  3. #3
    Forum Contributor
    Join Date
    06-06-2008
    Location
    Manchester
    MS-Off Ver
    MS Office 2003
    Posts
    161

    Re: Find Last Row & Paste

    Thanks for that, I have tried it, and it works but the problem is that it leaves a row between whats already there and the new dataset. If I take use the line ThisWorkbook.Sheets("Rota").Range("C" & Cells(1000, 3).End(xlUp).Row) it will then paste the data set in the correct row, but if I add another dataset after that it seems to delete the older set and replace with the new loaded in set. why would it do this? I just want it to again find the last row and paste the data set.

    Please Login or Register  to view this content.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Find Last Row & Paste

    Remember to Release objects prior to ending routine (ie wherever you Set x = ... you should subsequently Set x = Nothing ....) ... try the below adapation.

    Please Login or Register  to view this content.
    Last edited by DonkeyOte; 04-03-2009 at 04:37 AM.

  5. #5
    Forum Contributor
    Join Date
    06-06-2008
    Location
    Manchester
    MS-Off Ver
    MS Office 2003
    Posts
    161

    Re: Find Last Row & Paste

    RocknRoll, thats worked just how I was looking for

    Once again thanks!! :D

+ 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