+ Reply to Thread
Results 1 to 4 of 4

Copy and paste code pasting won't paste just values

  1. #1
    Registered User
    Join Date
    08-25-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Copy and paste code pasting won't paste just values

    I modified this code from another post, possibly another site and it works somewhat for me. But it pastes everything and I want only the values pasted, and to start on the second line of the target sheet (which it also refuses to do - starts on the first) but it makes no difference. The source sheet has formulas and when it pastes, it wants to calculate values on empty cells and I get a lot of zeros and gobbledy-gook on the target sheet.

    What's wrong with this formula?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Copy and paste code pasting won't paste just values

    change this line
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-25-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Copy and paste code pasting won't paste just values

    OK, so it's now pasting on the correct line (thank you for that), but unfortunately, it's still inserting the zeros and date values (eg.1900-01-00 0:00) that are part of the formulas for the cells, even when there is no data orginally in the cell. I think it's calculating it anyways for some reason when it goes to copy and paste to the target sheet (PassesMaster). I also attached the source sheet (isolated from the original source sheet because of confidential info) and the target sheet to show you how it's presenting. The source sheet was blank when copied to this new worksheet, so you can see it's somewhere in that process that it wants to automatically calculate the values.

    Thanks for your help so far. Much appreciated.
    Attached Files Attached Files

  4. #4
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Copy and paste code pasting won't paste just values

    The zeroes are appearing because of how the formula is entered. Starting from the last low, row 260 in the "Source sheet", it's returning 0 because B260 is blank, hence returning A261, which is also a blank, but in this case a value of 0 because that's how formulas work. And so the formula works its way up, displaying 0 all the way to the top. You have to either change the formula in row 260 or maybe type an apostrophe ( ' ) in row 261 so the formula returns blank instead of a 0.

+ 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 code to open new workbook and copy and paste special values
    By oddinho2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-12-2013, 11:24 PM
  2. Copy and paste as values in vba loop code
    By Kakkmaddafakka in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-15-2012, 08:24 AM
  3. [SOLVED] Set code copy and paste special values
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-25-2012, 08:52 PM
  4. [SOLVED] Code for Copy and Paste Special- Values in Columns
    By gautamacharya in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2012, 04:51 PM
  5. [SOLVED] code to FIND value, copy, paste values onto other sheet
    By ufo_pilot in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-06-2005, 12:20 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