Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying formulas to new cell
Cells(cRow-1,10).formula returns a string. It is not recognized as a
formula being copied - it is seen as an initial entry (entering a formula in the formula bar and hitting enter - therefore, no adjustment). With Activesheet.Cells(cRow-1,10) .Resize(2).Formula = .formula End With (in this case, the string is adjusted because it is the same as selecting two cells, entering a formula in the formula box and doing Ctrl+Enter) or ActiveSheet.Cells(cRow, 10).FillDown are other ways. Of course, these only work for contiguous cells. Regards, Tom Ogilvy 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying formulas from one cell to another | Excel Worksheet Functions | |||
Copying cell formulas | Excel Discussion (Misc queries) | |||
copying formulas and changing cell references | Excel Discussion (Misc queries) | |||
copying formulas to another cell | Excel Worksheet Functions | |||
Copying formulas to new cell | Excel Programming |