ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   setting cells with formulas (https://www.excelbanter.com/excel-programming/423639-setting-cells-formulas.html)

Russ

setting cells with formulas
 
This is really trivial but I can't seem to find the answer
I want to copy a formula from a cell in a column down to other cells in the
same column with a simple routine. A sample of which is below

Public Sub test_case()
Dim r As Long
With ActiveWorkbook.Sheets(1)
For r = 2 To 5
.Cells(r, 1).Formula = .Cells(1, 1)
Next
End With
End Sub

In cell(1,1) is a sample formula =RC2/RC3
I would like this formula to appear in the four cells below it. Running
this routine, Excel shows =RC2/RC3 in the cells but it is not a formula. I
have tried various things but nothing seems to work. Any help would be
greatly appreciated.
--
russ

curlydave

setting cells with formulas
 
Do you really need to ask the question multiple times?


All times are GMT +1. The time now is 02:54 AM.

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