Private Sub CommandButton1_Click()
Dim r As Range, ws As Worksheet, calc As Integer
Set ws = ActiveSheet 'Sheet1, Worksheets("Sheet1")
calc = Application.Calculation
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.EnableEvents = False
With ws
Set r = ws.Cells(ws.Rows.Count, "A").End(xlUp).Offset(1)
'Row 1 is usually a columns title row so line is seldom needed.
If r.Offset(-1).Value = "" Then Set r = r.Offset(-1) 'A1 could be ""
r.Value = WorksheetFunction.Max(ws.Columns("A")) + 1
With r.Offset(, 1)
.Value = Now
.NumberFormat = "mm/dd/yyyy h:mm:ss am/pm"
End With
End With
Application.Calculation = calc
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Private Sub CommandButton2_Click()
Dim r As Range, ws As Worksheet, calc As Integer
Set ws = ActiveSheet 'Sheet1, Worksheets("Sheet1")
calc = Application.Calculation
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.EnableEvents = False
With ws
Set r = ws.Cells(ws.Rows.Count, "C").End(xlUp).Offset(1)
'Row 1 is usually a columns title row so line is seldom needed.
If r.Offset(-1).Value = "" Then Set r = r.Offset(-1) 'C1 could be ""
r.Value = WorksheetFunction.Max(ws.Columns("C")) + 1
With r.Offset(, 1)
.Value = Now
.NumberFormat = "mm/dd/yyyy h:mm:ss am/pm"
End With
End With
Application.Calculation = calc
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Private Sub CommandButton3_Click()
Dim r As Range, ws As Worksheet, calc As Integer
Set ws = ActiveSheet 'Sheet1, Worksheets("Sheet1")
calc = Application.Calculation
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.EnableEvents = False
With ws
Set r = ws.Cells(ws.Rows.Count, "E").End(xlUp).Offset(1)
'Row 1 is usually a columns title row so line is seldom needed.
If r.Offset(-1).Value = "" Then Set r = r.Offset(-1) 'E1 could be ""
r.Value = WorksheetFunction.Max(ws.Columns("E")) + 1
With r.Offset(, 1)
.Value = Now
.NumberFormat = "mm/dd/yyyy h:mm:ss am/pm"
End With
End With
Application.Calculation = calc
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Private Sub CommandButton4_Click()
Dim r As Range, ws As Worksheet, calc As Integer
Set ws = ActiveSheet 'Sheet1, Worksheets("Sheet1")
calc = Application.Calculation
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.EnableEvents = False
With ws
Set r = ws.Cells(ws.Rows.Count, "G").End(xlUp).Offset(1)
'Row 1 is usually a columns title row so line is seldom needed.
If r.Offset(-1).Value = "" Then Set r = r.Offset(-1) 'G1 could be ""
r.Value = WorksheetFunction.Max(ws.Columns("G")) + 1
With r.Offset(, 1)
.Value = Now
.NumberFormat = "mm/dd/yyyy h:mm:ss am/pm"
End With
End With
Application.Calculation = calc
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
'Save (what, workbook) and exit
Private Sub CommandButton5_Click()
ThisWorkbook.Save
Unload Me
End Sub
Private Sub CommandButton6_Click()
Dim ws As Worksheet
Set ws = ActiveSheet 'Sheet1, Worksheets("Sheet1")
ws.Visible = xlSheetHidden
End Sub
Private Sub CommandButton7_Click()
Dim ws As Worksheet
Set ws = ActiveSheet 'Sheet1, Worksheets("Sheet1")
ws.Visible = xlSheetVisible
End Sub
Bookmarks