Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Copy Formula Instead of Value

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Copy Formula Instead of Value

Hi Jim,

Could you tell me what "FormulaR1C1" is? Why don't you use "Formula"
instead?

Also What is "Range("A2")"? Is it equivalent to "Cells(2, 1)"?

One more question: If I want to copy a formula to column K from row 4
to 50, what's the most efficient way to do it?

Thanks!

-Emily

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy formula result (text) only - without copying formula Mulberry Excel Discussion (Misc queries) 2 October 2nd 08 09:51 AM
I copy a formula and the results copy from the original cell brooklynsd Excel Discussion (Misc queries) 1 June 23rd 07 01:35 AM
copy formula down a column and have cell references change within formula brad New Users to Excel 5 May 13th 07 04:38 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
Copy formula so destination displays formula as text Omunene Excel Discussion (Misc queries) 2 September 30th 05 06:28 PM


All times are GMT +1. The time now is 12:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"