View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Copy Formula Instead of Value

This worked for me...

Sub test()
Sheet1.Range("A2").FormulaR1C1 = Sheet1.Range("A1").FormulaR1C1
End Sub
--
HTH...

Jim Thomlinson


"Emily" wrote:

Hi,

I've tried both of the following in my VB macro:

Sheet2.Cells(i, 17).Value = Sheet2.Cells(2, 17).Value

and

Sheet2.Cells(i, 17).Formula = Sheet2.Cells(2, 17).Formula

Either way, it sets the value to the value that appears in the cell.
I'll need to copy the formula over. Any advice on what syntax I shall
use? Many thanks!

-Emily