billandrew
Well-known Member
- Joined
- Mar 9, 2014
- Messages
- 743
This is an additional question from a previous post.
I received the following code, however when using in a different worksheet it is not working well. I am trying to place a total row (sum) and format this row. Possibly bold font & fill
The range is D5:Lxx). Column 12 may expand.
Dim lr As Long
For i = 4 To 12
lr = Cells(Rows.Count, i).End(xlUp).Row
If lr > 4 Then
Cells(lr + 1, i) = WorksheetFunction.Sum(Range(Cells(5, i), Cells(lr, i)))
Next i
I received the following code, however when using in a different worksheet it is not working well. I am trying to place a total row (sum) and format this row. Possibly bold font & fill
The range is D5:Lxx). Column 12 may expand.
Dim lr As Long
For i = 4 To 12
lr = Cells(Rows.Count, i).End(xlUp).Row
If lr > 4 Then
Cells(lr + 1, i) = WorksheetFunction.Sum(Range(Cells(5, i), Cells(lr, i)))
Next i