+ Reply to Thread
Results 1 to 9 of 9

Code to copy data in Col A from row 11

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

    Code to copy data in Col A from row 11

    I have written code to copy data from A11 on sheet1 and sheet3 to Col O from row 2 on sheet2


    The data from sheet1 is copied perfectly. I need the code amended so that when the data is copied from sheet3 to col O, it it pasted after the last item in Col O



    Please Login or Register  to view this content.

    Your assistance in this regard is most appreciated

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Code to copy data in Col A from row 11

    Change the second instance of this line:
    Please Login or Register  to view this content.
    to:
    Please Login or Register  to view this content.
    BSB

  3. #3
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Code to copy data in Col A from row 11

    Also, if the first set of data will always be pasted in O2 downward, why not just refer to that cell for the first paste rather than using .End(xlUp).Offset(1) ?

    BSB

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

    Re: Code to copy data in Col A from row 11

    Thanks for the advise, much appreciated

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

    Re: Code to copy data in Col A from row 11

    I have rechecked my data after running the code below


    The data from sheet1 is copied into cel O2 owards on sheet2 , but the data from A12 onwards on sheet3 is not copied in col O


    Please check code & advise

    Please Login or Register  to view this content.

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Code to copy data in Col A from row 11

    Try this:
    Please Login or Register  to view this content.
    BSB

  7. #7
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Code to copy data in Col A from row 11

    The problem in your code is you're using LR rather than LR1 in the second copy and paste, so it will only copying as many rows from Sheet3 as there are on Sheet1.

    BSB
    Last edited by BadlySpelledBuoy; 06-24-2018 at 02:43 AM. Reason: Typo

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

    Re: Code to copy data in Col A from row 11

    Thanks for your vhelp and pointing out where I went wrong.


    The code now works perfectly

  9. #9
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Code to copy data in Col A from row 11

    Happy to help

    BSB

+ 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. VB Code to copy certain data
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-20-2016, 12:34 PM
  2. VB Code to copy certain data
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-23-2015, 03:57 PM
  3. VBA code to make of copy of workbook2 and then copy data in that from Workbook1
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2015, 06:34 AM
  4. Replies: 2
    Last Post: 09-08-2014, 07:35 AM
  5. VBA code to copy data from Excel data table to user form
    By Srikanth H N in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-03-2014, 11:53 AM
  6. Code to Copy Data to Every nth Row
    By Winon in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-07-2012, 05:38 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