Sub SubTotl()
Dim Top As String, Bot As String, Fx As String
Dim OSet As Integer
OSet = -1
Bot = ActiveCell.Offset(0, OSet).Address
If Left(ActiveCell.End(xlUp).Formula, 1) <> "=" Then
Top = ActiveCell.End(xlUp).Offset(0, OSet).Address
Else
Top = ActiveCell.End(xlUp).Offset(1, OSet).Address
End If
Fx = "=Sum(" & Top & ":" & Bot & " ) "
ActiveCell.Formula = Fx
Selection.Font.Bold = False
End Sub
Sub RunTotl()
Dim Top As String, Bot As String, Fx As String
Dim OSet As Integer
OSet = -1
Bot = ActiveCell.Offset(0, OSet).Address
Top = Cells(1, ActiveCell.Column() + OSet).Address
Fx = "=Sum(" & Top & ":" & Bot & " ) "
ActiveCell.Formula = Fx
Selection.Font.Bold = True
End Sub
|