Results 1 to 5 of 5

Thread: Excel - paste special values

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    Resolved Excel - paste special values

    Is there a way to automatically select all formulas in a worksheet and do a paste special, replacing the formulas with their values, in code?
    Basically, we have an Access db that creates an Excel worksheet, and then other people in the company do whatever they do with it. They don't want any formulas in the worksheet though, although they're needed to calculate the values. I have pretty limited experience with Excel programming. Thanks.
    Last edited by salvelinus; Mar 24th, 2005 at 11:37 AM.
    Tengo mas preguntas que contestas

  2. #2
    Addicted Member
    Join Date
    Jan 2002
    Location
    Glasgow, Scotland
    Posts
    202

    Re: Excel - paste special values

    this should work.

    Code:
        Cells.Select
        Selection.Copy
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    if you fail to plan, you plan to fail

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    Re: Excel - paste special values

    Thanks, that works, except that it leaves the marquee outline around everything. How do I get rid of that? If I just select another cell, the marquee remains.
    Tengo mas preguntas que contestas

  4. #4
    Addicted Member
    Join Date
    Jan 2002
    Location
    Glasgow, Scotland
    Posts
    202

    Re: Excel - paste special values

    Put this after the first section of code:

    Code:
    Application.CutCopyMode = False
    if you fail to plan, you plan to fail

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    Re: Excel - paste special values

    Thanks. I was looking for a counterpart to Cells.Select, like Cells.Unselect. That would be more consistent, but whatever. Thanks again.
    Tengo mas preguntas que contestas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width