MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
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
Title | # Comments | Views | Activity |
---|---|---|---|
Excel VBA Workbook - Change hours | 2 | 38 | |
usage of ms/excell 3d maps in ms/access 2016 | 6 | 36 | |
Simple Absolute Addressing Problem in an Excel Macro | 25 | 41 | |
Automate an Oracle update in Excel | 7 | 62 |
Join the community of 500,000 technology professionals and ask your questions.