What I would like to do is copy (by ctrl C) a cell or range of cells so that it goes into the clipboard. Then when I run the macro (I will create a shortcut) it will paste it to the selected cell (or if a range will paste down / across / range - the same way regular ctrl C / ctrl V works).
However, the paste would be the EXACT formula in the cell I copied. Without changing the references. Kinda like cut and paste without losing the original formula.
For the sake of being overly clear: I have this formula in cell A4 "=A1+A2". I want to be able to press ctrl C when I selected A4 (not in edit mode). Then select B4 and run my macro and it will put "=A1+A2" in B4. But also be able to use the macro with a range.
I tried this, but it only gives me the value.
Thank you so much for any guidance!
However, the paste would be the EXACT formula in the cell I copied. Without changing the references. Kinda like cut and paste without losing the original formula.
For the sake of being overly clear: I have this formula in cell A4 "=A1+A2". I want to be able to press ctrl C when I selected A4 (not in edit mode). Then select B4 and run my macro and it will put "=A1+A2" in B4. But also be able to use the macro with a range.
I tried this, but it only gives me the value.
VBA Code:
Dim DataObj As MSForms.DataObject
Set DataObj = New MSForms.DataObject
DataObj.GetFromClipboard
strPaste = DataObj.GetText(1)
Thank you so much for any guidance!