Copy and paste a formula using a macro

Solved
fagots Posted messages 96 Status Membre -  
fagots Posted messages 96 Status Membre -
Hello everyone,
I am looking to copy and paste the formula contained in a cell to another sheet in the same workbook. I would like to do this with a macro, but it doesn't work.
Can you help me?
Best regards,
--
Fagots

1 réponse

via55 Posted messages 14730 Registration date   Status Membre Last intervention   2 755
 
Hello

If you perform the operation while having the macro recorder connected to copy a cell and make a Paste Special for Formulas only, the macro should look something like this:
Sub copyformula() ' cell of the formula to copy Range("C1").Select Selection.Copy 'cell where to copy the formula Range("F15").Select Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False End Sub


Best regards
Via

"Imagination is more important than knowledge." A. Einstein
0
fagots Posted messages 96 Status Membre
 
OK and thank you, it works perfectly.
Best regards
Fagots
0