R
ryguy7272
I’ve got a variable little groups of cells that need to be summed. They can
appear higher or lower on a sheet and the only way I can think of identifying
the groups is as follows. Look for an indicator in Column A, which is
actually ‘(A)’, then move right 5 cells and up 2 cells, but the group of
cells that need to be summed is variable.
Please look at my code and offer suggestions:
Cells.Find(What:="(A)*", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 5).Select
ActiveCell.Offset(-2, 0).Select
RowCount = 12
ActiveCell.FormulaR1C1 = "=SUM(R[" & -RowCount & "]C:R[-2]C)"
The number of rows that I need to sum will not always be 12, it could be
anything. In my current example, the array goes from F132:F143.
Any ideas on how to do this?
Thanks,
Ryan---
appear higher or lower on a sheet and the only way I can think of identifying
the groups is as follows. Look for an indicator in Column A, which is
actually ‘(A)’, then move right 5 cells and up 2 cells, but the group of
cells that need to be summed is variable.
Please look at my code and offer suggestions:
Cells.Find(What:="(A)*", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 5).Select
ActiveCell.Offset(-2, 0).Select
RowCount = 12
ActiveCell.FormulaR1C1 = "=SUM(R[" & -RowCount & "]C:R[-2]C)"
The number of rows that I need to sum will not always be 12, it could be
anything. In my current example, the array goes from F132:F143.
Any ideas on how to do this?
Thanks,
Ryan---