Can´t Convert Formulas to Values with Deactivate event

R

Rolo

Hi Excel Gurus. I really appreciate your help !

I have a sheet with many formulas. When I leave the sheet I want to
convert them to values.

Macro Recorder gives this:

Range("D15:E16").Select
Selection.Copy
Range("D15").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _:=False, Transpose:=False
Range("D14").Select

But when I apply this code to the Deactivate sheet event it gives an
error (it seems it doesn´t accept the selection method in the above
code).

Can anybody help me???
 
T

Tom Ogilvy

me.Range("D15:E16").Copy
me.Range("D15:E16").PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _:=False, Transpose:=False
 
D

Don Guillett

Modify this to suit your ranges.

Sub makevalues()
[b17:b20].Formula = [b17:b20].Value

'or
'[b17:b20].Value = [b17:b20].Value
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top