If you want to do this often Chip Pearson posted code for a macro
to be used as a right click menu. You have to install it into your
workbook. Refer to the links so you install code into your
Aut
pen macro.
Sub CopyFormula()
'Chip Pearson, microsoft.public.excel.worksheet.functions, 2000/05/02
'
http://groups.google.com/groups?hl=en&newwindow=1&th=4831aec5cbe19367&rnum=1
'
http://groups.google.com/groups?as_umsgid=OWeRetUjBHA.2212@tkmsftngp05
Dim x As New DataObject
x.SetText ActiveCell.Formula
x.PutInClipboard
End Sub
Sub PasteFormula()
On Error Resume Next
Dim x As New DataObject
x.GetFromClipboard
ActiveCell.Formula = x.GetText
End Sub
'--- add this code to your Aut
pen
'Chip Pearson via Drew Paterson -- 2001-04-13 misc
'--http://groups.google.com/groups?threadm=uiqh89AxAHA.1620%40tkmsftngp05
Application.CommandBars("Cell").Reset 'was not in 2001-04-13 posting
With Application.CommandBars("Cell").Controls
With .Add
.Caption = "C&opy Formula"
.OnAction = ThisWorkbook.Name & "!CopyFormula"
.Tag = "Formulas" 'cControlTag
.BeginGroup = True
End With
With .Add
.Caption = "P&aste Formula"
.OnAction = ThisWorkbook.Name & "!PasteFormula"
.Tag = "Formulas2" 'cControlTag
End With
End With
'instead of Aut
pen use Workbook_Open in the ThisWorklbook
' when you need to fire off a macro when opening with code.
--