+ Reply to Thread
Results 1 to 7 of 7

Changing Current Code from Paste Formulas to Paste Values

  1. #1
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Changing Current Code from Paste Formulas to Paste Values

    Hello Everyone,

    I have some code here that I got help with a while back - I've looked through it and I'm not exactly sure of the best way to change it so that the macro pastes values instead of formulas.

    In case it helps, a quick rundown of what this code does:

    It goes through each Excel file in a folder, copies a certain portion of the file, then pastes it in order in the macro workbook. Again, my goal is for the macro to copy the portion of each file and paste it in to the macro workbook so all formulas are now just values.

    Here is the code:

    Please Login or Register  to view this content.
    If you can find anything else in here that you think might speed it up or help, I'm always open for suggestions!

    Thanks in advance!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Changing Current Code from Paste Formulas to Paste Values

    Perhaps.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Re: Changing Current Code from Paste Formulas to Paste Values

    Hi Norie,

    That doesn't seem like an option according to VBA. I'm getting a compile error when I try to enter that code.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Changing Current Code from Paste Formulas to Paste Values

    When I change this code to what I suggested I don't get a compile error.
    Please Login or Register  to view this content.
    What's the actual message?

  5. #5
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Re: Changing Current Code from Paste Formulas to Paste Values

    When "rToCopy.Copy rNextCl" is changed to "rToCopy.Copy rNextCl.PasteSpecial xlPasteValues" I get:

    "Compile error: Expected: end of statement" and the xlPasteValues part is highlighted.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Changing Current Code from Paste Formulas to Paste Values

    Why have you combined the 2 lines of code I posted into 1 line?

  7. #7
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Re: Changing Current Code from Paste Formulas to Paste Values

    Ah - My apologies. I thought it needed to be like that due to thats the how the code was originally put together. It looks like everything works now!

    Thanks for your help Norie! You are amazing!

+ 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. Copy and paste code pasting won't paste just values
    By thehotbreadguy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-09-2013, 11:12 PM
  2. [SOLVED] Macro to paste formulas then paste values
    By deanstein in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-19-2013, 11:30 AM
  3. VBA Copy-paste values with changing paste location
    By booost in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-16-2012, 10:39 AM
  4. Changing code to paste as values
    By rhudgins in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-25-2010, 09:18 PM
  5. Copying & Paste Without The Formulas Automatically Changing
    By Karleajensar in forum Excel General
    Replies: 4
    Last Post: 11-10-2007, 10:24 AM

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