Copy formulas exact without references changing

  • Thread starter Thread starter mikeburg
  • Start date Start date
M

mikeburg

Trying to come up with a VBA procedure to copy a cell formula exact into
the clipboard that I can paste (cntrl+V) in any other desired cells
without the references changing. That way, I can assign the keys
Shift+Ctrl+E to the procedure for a short cut. I know about the $ but
there are too many formulas to edit.

I now do it manually as follows:
On the desired cell, F2
Ctrl + Shift + Home
Ctrl + C
Esc

Any ideas?

mikeburg
 
mikeburg said:
Trying to come up with a VBA procedure to copy a cell formula exact into
the clipboard that I can paste (cntrl+V) in any other desired cells
without the references changing. That way, I can assign the keys
Shift+Ctrl+E to the procedure for a short cut. I know about the $ but
there are too many formulas to edit.

I now do it manually as follows:
On the desired cell, F2
Ctrl + Shift + Home
Ctrl + C
Esc

Any ideas?

mikeburg

Dim A as String
A = [B50].Formula

Ciao
Bruno
 
You can change from relative to absolute en masse using VBA

Sub Absolute()
Dim Cell As Range
For Each Cell In Selection
If Cell.HasFormula Then
Cell.Formula = Application.ConvertFormula(Cell.Formula, _
xlA1, xlA1, xlAbsolute)
End If
Next
End Sub


Gord Dibben Excel MVP
 
Ciao Bruno's vba code works great. But how do I get the contents of
variable A into the clipboard?

Thanks a million, mikeburg
 

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

Back
Top