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.
Re: Excel - paste special values
this should work.
Code:
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
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.
Re: Excel - paste special values
Put this after the first section of code:
Code:
Application.CutCopyMode = False
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.