ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy formulas exact without references changing (https://www.excelbanter.com/excel-programming/344976-copy-formulas-exact-without-references-changing.html)

mikeburg[_48_]

Copy formulas exact without references changing
 

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
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=482978


Bruno Campanini[_3_]

Copy formulas exact without references changing
 
"mikeburg" wrote in
message ...

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



Gord Dibben

Copy formulas exact without references changing
 
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



. I know about the $ but
there are too many formulas to edit.



mikeburg[_49_]

Copy formulas exact without references changing
 

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

Thanks a million, mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=482978



All times are GMT +1. The time now is 05:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com