Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.
Become a Premium Member and unlock a new, free course in leading technologies each month.
Private Sub CommandButton1_Click()
Dim lrow As Long
lrow = Cells(65536, "D").End(xlUp).Row
Cells(lrow + 2, "I").Formula = "=sum(I16:I" & lrow & ")"
Cells(lrow + 2, "J").Formula = "=sum(J16:J" & lrow & ")"
Cells(lrow + 2, "K").Formula = "=sum(K16:K" & lrow & ")"
Cells(lrow + 2, "L").Formula = "=sum(L16:L" & lrow & ")"
Cells(lrow + 2, "M").Formula = "=sum(M16:M" & lrow & ")"
Cells(lrow + 2, "N").Formula = "=sum(N16:N" & lrow & ")"
Cells(lrow + 2, "O").Formula = "=sum(O16:O" & lrow & ")"
Cells(lrow + 2, "F") = "Total Hours"
Range("I" & lrow + 2 & ":O" & lrow + 2).Font.Bold = True
Cells(lrow + 2, "F").Font.Bold = True
End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Private Sub ToggleButton1_Click()
If ToggleButton1.Value Then
'Toggle on code
Dim lrow As Long
lrow = Cells(65536, "D").End(xlUp).Row
Cells(lrow + 2, "I").Formula = "=sum(I16:I" & lrow & ")"
Cells(lrow + 2, "J").Formula = "=sum(J16:J" & lrow & ")"
Cells(lrow + 2, "K").Formula = "=sum(K16:K" & lrow & ")"
Cells(lrow + 2, "L").Formula = "=sum(L16:L" & lrow & ")"
Cells(lrow + 2, "M").Formula = "=sum(M16:M" & lrow & ")"
Cells(lrow + 2, "N").Formula = "=sum(N16:N" & lrow & ")"
Cells(lrow + 2, "O").Formula = "=sum(O16:O" & lrow & ")"
Cells(lrow + 2, "F") = "Total Hours"
Range("I" & lrow + 2 & ":O" & lrow + 2).Font.Bold = True
Cells(lrow + 2, "F").Font.Bold = True
Else
'Toggle Off code
Dim lrow As Long
lrow = Cells(65536, "D").End(xlUp).Row
Cells(lrow + 2, "I").Formula = ""
Cells(lrow + 2, "J").Formula = ""
Cells(lrow + 2, "K").Formula = ""
Cells(lrow + 2, "L").Formula = ""
Cells(lrow + 2, "M").Formula = ""
Cells(lrow + 2, "N").Formula = ""
Cells(lrow + 2, "O").Formula = ""
Cells(lrow + 2, "F") = ""
Range("I" & lrow + 2 & ":O" & lrow + 2).Font.Bold = False
Cells(lrow + 2, "F").Font.Bold = False
End If
End Sub
Private Sub ToggleButton1_Click()
Dim lrow As Long
If ToggleButton1.Value Then
'Toggle on code
lrow = Cells(65536, "D").End(xlUp).Row
Cells(lrow + 2, "I").Formula = "=sum(I16:I" & lrow & ")"
Cells(lrow + 2, "J").Formula = "=sum(J16:J" & lrow & ")"
Cells(lrow + 2, "K").Formula = "=sum(K16:K" & lrow & ")"
Cells(lrow + 2, "L").Formula = "=sum(L16:L" & lrow & ")"
Cells(lrow + 2, "M").Formula = "=sum(M16:M" & lrow & ")"
Cells(lrow + 2, "N").Formula = "=sum(N16:N" & lrow & ")"
Cells(lrow + 2, "O").Formula = "=sum(O16:O" & lrow & ")"
Cells(lrow + 2, "F") = "Total Hours"
Range("I" & lrow + 2 & ":O" & lrow + 2).Font.Bold = True
Cells(lrow + 2, "F").Font.Bold = True
Else
'Toggle Off code
lrow = Cells(65536, "D").End(xlUp).Row
Cells(lrow + 2, "I").Formula = ""
Cells(lrow + 2, "J").Formula = ""
Cells(lrow + 2, "K").Formula = ""
Cells(lrow + 2, "L").Formula = ""
Cells(lrow + 2, "M").Formula = ""
Cells(lrow + 2, "N").Formula = ""
Cells(lrow + 2, "O").Formula = ""
Cells(lrow + 2, "F") = ""
Range("I" & lrow + 2 & ":O" & lrow + 2).Font.Bold = False
Cells(lrow + 2, "F").Font.Bold = False
End If
End Sub
If you are experiencing a similar issue, please ask a related question
Join the community of 500,000 technology professionals and ask your questions.