La suma y el formato de la última columna totales lo logras con este código, sumado al anterior que ya pase en la pregunta anterior.
Sub suma()
Dim a, r4 As String
Dim uf, uf1, fila As Integer
a = ActiveSheet.Name
uf = Sheets(a).Range("A" & Rows.Count).End(xlUp).Row
uf = uf + 1
Range("A" & uf) = "TOTAL DE HORAS"
Range("A" & uf & ":" & "C" & uf).Select
With Selection
.MergeCells = True
.Interior.Color = 5296274
.HorizontalAlignment = xlCenter
End With
With Selection.Font
.Name = "Calibri"
.Size = 12
.Bold = True
End With
Range("E" & uf) = "ALUMNOS"
Range("E" & uf & ":" & "H" & uf).Select
With Selection
.MergeCells = True
.Interior.Color = 5296274
.HorizontalAlignment = xlCenter
End With
With Selection.Font
.Name = "Calibri"
.Size = 12
.Bold = True
End With
Range("D" & uf).Select
Selection.Interior.ThemeColor = xlThemeColorAccent2
With Selection.Font
.Name = "Calibri"
.Size = 11
End With
Range("I" & uf & ":" & "K" & uf).Select
Selection.Interior.Color = 65535
With Selection.Font
.Name = "Calibri"
.Size = 11
End With
Range("L" & uf & ":" & "N" & uf).Select
Selection.Interior.Color = 5287936
With Selection.Font
.Name = "Calibri"
.Size = 8
End With
Range("O" & uf & ":" & "Q" & uf).Select
Selection.Interior.Color = 255
With Selection.Font
.Name = "Calibri"
.Size = 8
End With
fila = 7
uf1 = uf - 1
r4 = "D" & fila & ":" & "D" & uf1
Cells(uf, 4).Formula = "=SUM(" & r4 & ")"
Cells(uf, 4).Copy
Range(Cells(uf, 9), Cells(uf, 9).Offset(0, 8)).Select
Selection.PasteSpecial Paste:=xlFormulas
Cells(uf, 1).Select
End Sub