ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying formulas to new cell (https://www.excelbanter.com/excel-programming/274387-re-copying-formulas-new-cell.html)

BrianB

Copying formulas to new cell
 
According to my experience you are correct.

Regards
BrianB
=======================================


"Ed Bitzer" wrote in message ...
To copy a formula (with smart adjustment for the new location) from cRow
4 to cRow 5 where cRow = 5 I can use:
ActiveSheet.Cells(cRow - 1, 10).Copy
ActiveSheet.Cells(cRow, 10).PasteSpecial Paste:=xlPasteFormulas
Is this the "best" way?
I am surprised that this:
Cells(cRow, 10).Formula = Cells(cRow - 1, 10).Formula
does not work. It copies the formula but without adjustment for the new
location.

Ed



All times are GMT +1. The time now is 01:56 PM.

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