Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
i have a problem with the following code, would appreciate if anyone can give me some help on this. Basically everything works fine except for this line: Cells(i, 12).FormulaR1C1 = "=SUM(J" & StartCount & ":J" & EndCount & ")" The cell will reflect "=SUM('J2':'J3')" instead of "=SUM(J2:J3)". --------------------------------------------------------------------------------------------- Sub Test() For i = 2 To 100 Step 1 Cells(i, 1).Select If Cells(i, 1).Interior.ColorIndex = 2 Then StartCount = ActiveCell.Row ElseIf Cells(i, 1).Interior.ColorIndex = 37 Then EndCount = ActiveCell.Row Cells(i, 12).FormulaR1C1 = "=SUM(J" & StartCount & ":J" & EndCount & ")" End If Next i End Sub ---------------------------------------------------------------------------------------- Thanks in advance Rgds Ray |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error in cell formula | Excel Programming | |||
Formula error - cell reference | Excel Discussion (Misc queries) | |||
Error putting a formula in a cell with vba | Excel Programming | |||
error in one cell and formula in other | Excel Worksheet Functions | |||
Formula expected end of statement error, typing formula into cell as part of VBA macro | Excel Programming |