+ Reply to Thread
Results 1 to 13 of 13

Paste Data after last row containing Data

  1. #1
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Paste Data after last row containing Data

    I have the following code which I am trying to copy data from sheet "Data" and pasting the data on specific sheets based onthe names in Col A. This must be pasted after the last row containing data on those sheets


    I get a run time error "copy method of range class failed" and the code below is highlighted


    Please Login or Register  to view this content.

    It would be appreciated if someone could kindly amend my code

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Paste Data after last row containing Data

    Please Login or Register  to view this content.
    This should be because A1 is already the top cell so you can't go up anymore.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Paste Data after last row containing Data

    Thanks for your help


    I amended the code as folows:


    Please Login or Register  to view this content.

    When Running the macro, I get compile error : syntax eror


    Please check & advise

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Paste Data after last row containing Data

    My bad. Remove double quotes after
    Please Login or Register  to view this content.

  5. #5
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Paste Data after last row containing Data

    Thanks for pointing out the problem. I should have picked this up

  6. #6
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Paste Data after last row containing Data

    Thanks for all your help

    on testing the macro, it clears the data onnthe source sheet


    Please check macro as this should not be happening
    Attached Files Attached Files

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Paste Data after last row containing Data

    Your post does not comply with Rule 8 of our Forum RULES.

    Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    HTH
    Regards, Jeff

  8. #8
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Paste Data after last row containing Data

    My apologies Jeff . I inavertently forgot to post the link

    https://www.mrexcel.com/forum/excel-...heet-name.html

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Paste Data after last row containing Data

    Where did this line go ????
    Please Login or Register  to view this content.

  10. #10
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Paste Data after last row containing Data

    I removed it as I did not think that it was necessary

  11. #11
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Paste Data after last row containing Data

    Well, now you know it is.

    PS: Thanks for rep+.

  12. #12
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Paste Data after last row containing Data

    I do thanks. I learn something new every day from guys like yourself as well as the many excel forum experts who voluntarily give up their time to help others like myself. I certainly appreciate the help I get, which has improved my Excel skills tremendously

  13. #13
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Paste Data after last row containing Data

    You're more then welcome. Keep leraning.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. [SOLVED] Find matching data, copy data in adjacent cell and paste in new column
    By Bikeman in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-23-2015, 04:08 PM
  2. [SOLVED] Copy Data from one sheet and paste the consolidated data into another (Data Range Varies)
    By kittu55 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-13-2013, 10:02 PM
  3. Enter data, copy formulas, copy values, paste data, delete data
    By alf40 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2013, 07:23 PM
  4. Web Query dynamic destination or VBA to copy and paste new data alongside existing data
    By Marbleking in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-12-2012, 06:03 PM
  5. Replies: 2
    Last Post: 07-18-2012, 09:11 AM
  6. Charting file template to clear old data, paste new data and update chart
    By cwilliams321 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-29-2012, 04:13 PM
  7. Easiest way to Copy/Paste data from Recurring Form to an Historical Data Sheet
    By willy91785 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-15-2010, 02:11 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