+ Reply to Thread
Results 1 to 5 of 5

Destination copy and paste (values only) for copy loop

  1. #1
    Registered User
    Join Date
    02-05-2013
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2010
    Posts
    39

    Destination copy and paste (values only) for copy loop

    Hi guys I'm trying to copy and paste a title and subtotal from a range of data in columns AD:AF;

    Example;
    BH113 13/03/2013 72
    13/03/2013 106
    13/03/2013 67
    Total 245

    BH114 5/03/2013 92
    7/03/2013 77
    13/03/2013 90
    14/03/2013 59
    18/03/2013 52
    19/03/2013 44
    21/03/2013 88
    Total 502

    CR102 25/03/2013 107
    27/03/2013 117
    Total 224

    I want to paste the information in columns O:P to look like the following as a summary, so the data needs to be pasted as values only;

    BH113 245
    BH114 502
    CR102 224

    Here is the code I have so far,

    Please Login or Register  to view this content.
    This code copies the data into the correct columns, but it doesn't paste values only and the data from clolumn AD all ends up as the last value (CR102)

    Help would be greatly appreciated.

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Destination copy and paste (values only) for copy loop

    Please post a sample workbook. My immediate thought would be to use the pastespecial method against a range object. Something like...

    Please Login or Register  to view this content.
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  3. #3
    Registered User
    Join Date
    02-05-2013
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Destination copy and paste (values only) for copy loop

    Here is an example of my sheet.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Destination copy and paste (values only) for copy loop

    An array approach. Please make a copy of your workbook and test on the copy.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-05-2013
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Destination copy and paste (values only) for copy loop

    This works beautifully AlvaroSiza!!! Thankyou so much!!

+ 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