|
-
Mar 23rd, 2005, 11:00 AM
#1
Thread Starter
Frenzied Member
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
-
Mar 23rd, 2005, 11:10 AM
#2
Addicted Member
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
-
Mar 23rd, 2005, 07:40 PM
#3
Thread Starter
Frenzied Member
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
-
Mar 24th, 2005, 05:32 AM
#4
Addicted Member
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
-
Mar 24th, 2005, 11:36 AM
#5
Thread Starter
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|