Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paste Exact Formula

Status
Not open for further replies.

sabascal

IS-IT--Management
Aug 20, 2002
85
0
0
GB
Hi,

I am writting small macros to be linked at shortcuts to automate routines.
One on them is "Paste Exact Formula".
I would like to be able to paste to a range exact formula I select in another range - Basically replicate the "Paste Formulas" feature that already exist by "Paste EXACT formula"

Here is what I have soe far. I did not manage to by pass a msgbox. I guess the solution is to loop through the active selection in the clipboard.


Can somebody help?

----
Sub CutPasteExactFormula()

' Macro5 Macro
' Macro recorded 5/21/2003 by Simon Lauzier
'
' Keyboard Shortcut: Ctrl+Shift+E

Set mycell = Application.InputBox(prompt:="Select Cell", Type:=8)
myrange = mycell.FormulaLocal

Selection = myrange

End Sub---
 
Don't know if this will really help but if you mean to keep the formula the same - ie. not change as with .Formula, you can use .Value like this :-

s = "=A1"
Range("B2").Value = s
Range("C2").Value = s


Regards
BrianB
Use CupOfCoffee to speed up all windows applications
================================
 
Not Exactly the answer I was looking for - Thanks Though -

What I am trying to do is replication the built in copy paste formula function; Execpt that I want tbe able to paste excact formulas.

Can somebody help?
 
Take a look at the PasteSpecial method of the Range object.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top