Michael M
Well-known Member
- Joined
- Oct 27, 2005
- Messages
- 21,894
- Office Version
- 365
- 2019
- 2013
- 2007
- Platform
- Windows
Hi
I currently use this to create a formula in column "G" wherever there is a bold cell, and it SUMS up as far as the next Bold cell, -1 row.
How do I change the code to SUM down to the next Bold cell,-1 row.
I simply can't get my head around this, at the moment.
Any assistance greatly appreciated.
I currently use this to create a formula in column "G" wherever there is a bold cell, and it SUMS up as far as the next Bold cell, -1 row.
How do I change the code to SUM down to the next Bold cell,-1 row.
I simply can't get my head around this, at the moment.
Code:
s = 13
For Each r In Range("G13:G" & lrow) 'ADDS SUBTOTALS AT EACH BOLD CELL IN "G"
If r.Font.Bold = True Then
With r
.Formula = "=sum(r" & s & "c:r" & r.Row - 1 & "c)"
.Interior.ColorIndex = 36
End With
Any assistance greatly appreciated.