+ Reply to Thread
Results 1 to 3 of 3

PasteSpecial xlPasteValues Compile Error

  1. #1
    Forum Contributor
    Join Date
    09-19-2004
    Location
    Canada
    Posts
    408

    PasteSpecial xlPasteValues Compile Error

    Hi everyone,

    When I add the ".PasteSpecial . . . " at the end of the following line, I am getting Compile error "Expected: end of statement" and I can't figure out how to fix it.

    Please Login or Register  to view this content.
    Any help, please?

    Gos-C
    Using Excel 2010 & Windows 10
    "It is better to be prepared for an opportunity and not have one than to have an opportunity and not be prepared."

  2. #2
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: PasteSpecial xlPasteValues Compile Error

    You cannot copy and paste values on a single line of code... you would have to copy the range first and then PasteSpecial the values on a second line. However, since we are talking of copying contiguous values only... don't copy them, just assign them directly...
    Please Login or Register  to view this content.
    Last edited by Rick Rothstein; 12-22-2020 at 07:25 PM.

  3. #3
    Forum Contributor
    Join Date
    09-19-2004
    Location
    Canada
    Posts
    408

    Re: PasteSpecial xlPasteValues Compile Error

    Ah! I understand. Great, thank you very much, Rick.

+ 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. Replies: 3
    Last Post: 12-07-2020, 04:57 PM
  2. [SOLVED] PasteSpecial xlPasteValues & xlPasteFormats doesn't want to work for me?
    By peejaygee in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-20-2017, 04:52 PM
  3. [SOLVED] compile error with selection.pastespecial code
    By philaugust2004 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-05-2017, 03:39 PM
  4. [SOLVED] Pastespecial xlPasteValues Runtime Error 1004
    By natefarm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2013, 01:37 PM
  5. [SOLVED] SpecialCells(xlCellTypeFormulas).PasteSpecial Paste:=xlPasteValues
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-23-2013, 12:37 PM
  6. [SOLVED] Pastespecial xlPastevalues
    By colgabusa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2013, 10:49 PM
  7. Ron de Bruin - Using PasteSpecial (xlPasteValues) instead of Copy
    By Bob in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-16-2006, 03:00 PM

Tags for this Thread

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