Hi all,
Im having issues coming up with a code to add the cells next to a merged cell.
This is an example of the table. the first column does not have merged rows, but the second does. I need the second column to be the sum of the first column ..
my data starts on the 4th row, and the 8th column.
this is the code i have now:
Im having issues coming up with a code to add the cells next to a merged cell.
This is an example of the table. the first column does not have merged rows, but the second does. I need the second column to be the sum of the first column ..
my data starts on the 4th row, and the 8th column.
this is the code i have now:
VBA Code:
With ActiveSheet
For i0 = 4 To .UsedRange.rows.count
If Not .Cells(i0, 1).Value = strName Then
strName = .Cells(i0, 1)
i1 = i0
End If
.Cells(i1, 9).Value = .Cells(i0, 8) + .Cells(i0 + 1, 8).Value
Next i0
End With
1 2 3 | sum of the 3 cells to the left |
1 3 | sum of the 2 cells to the left |
1 2 | sum of the 2 cells to the left |