Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formulas
I am having problems inserting contents of two cells in to one cell. I am
using the following code to name cells in a range and inserting a formula into another cell. Sub anamecells() Dim xcell As Range Dim ycell As Range Dim tcell As Range Dim i As Integer Dim j As Integer Dim est As String Dim r As Integer Dim c As Integer Dim nm As String Set xcell = Range("b4") Set tcell = Range("ak3") For i = 2 To 9 Set ycell = xcell.Offset((i - 1) * 23, 0) est = "est0" & i For j = 1 To 19 r = tcell.Offset(j, 0) c = tcell.Offset(j, 1) nm = tcell.Offset(j, 2) ycell.Offset(r, c).name = est & nm Range(ycell.Offset(0, 0), ycell.Offset(17, 24)).name = est & "rng" Next Range(est).FormulaR1C1 = _ "=('Estimate Costs'!R[" & i & "]C[7]&"" ""&'Estimate Costs'!R[" & i & "]C[8])" Range(est & "totalsum") = "=sum(" & est & "totalrng)" Next End Sub The formula I am trying to insert into a cell needs to increment down one row. the code I am using is: Range(est).FormulaR1C1 = _ "=('Estimate Costs'!R[" & i & "]C[7]&"" ""&'Estimate Costs'!R[" & i & "]C[8])" Instead of icrementing down one row it is incrementing down in multiples of 23. I assume because of where I am setting ycell. How do I get this formula to imcrement down only 1 row at a time? Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
E2007 formulas display as formulas, not results | Excel Worksheet Functions | |||
Counting # of Formulas in a column with formulas and entered data | Excel Worksheet Functions | |||
CELLS NOT CALC FORMULAS - VALUES STAY SME FORMULAS CORRECT?? HELP | Excel Worksheet Functions | |||
Formulas not evaluated, Formulas treated as strings | Excel Discussion (Misc queries) | |||
AdvancedFilter on cells with formulas, returning values and not formulas | Excel Programming |