Private Sub Worksheet_Change(ByVal Target As Range)
'Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'B will update if A is edited
Dim today
With Application
.ScreenUpdating = False
End With
On Error GoTo enditall
today = Format(Now(), "Day")
If Target.Cells.Column = 1 Then
n = Target.Row
If Sheets("sheet1").Range("A" & n).Value <> "" Then
Sheets("sheet1").Range("B" & n).Value = Format(Now(), "hh:mm AMPM")
End If
If Sheets("sheet1").Range("A" & n).Value <> "" Then
Sheets("sheet1").Range("C" & n).Value = Format(Now(), "mm/dd/yyyy")
End If
End If
If Target.Cells.Column = 1 Then
If Format(Now(), "dddd") = "Monday" Then Monday
If Format(Now(), "dddd") = "Tuesday" Then Tuesday
If Format(Now(), "dddd") = "Wednesday" Then Wednesday
If Format(Now(), "dddd") = "Thursday" Then Thursday
If Format(Now(), "dddd") = "Friday" Then Friday
End If
'Compare A1-Sheet1 to A1 Sheet2 if match then put name and grade
Check = True: Counter = 0
Do 'Outer loop.
Do 'Inner Loop.
Counter = Counter + 1
If Sheets("sheet2").Range("A" & Counter) = "EOF" Then
Check = False ' Set value of flag to False.
Exit Do ' Exit inner loop.
End If
If Sheets("sheet1").Range("A" & n).Value = Sheets("sheet2").Range("A" & Counter) Then
Sheets("sheet1").Range("D" & n).Value = Sheets("sheet2").Range("B" & Counter)
End If
If Sheets("sheet1").Range("A" & n).Value = Sheets("sheet2").Range("A" & Counter) Then
Sheets("sheet1").Range("E" & n).Value = Sheets("sheet2").Range("C" & Counter)
End If
If Sheets("sheet1").Range("A" & n).Value = Sheets("sheet2").Range("A" & Counter) Then
Sheets("sheet1").Range("F" & n).Value = Sheets("sheet2").Range("D" & Counter)
End If
Loop While Check <> False
Loop Until Check = False
With Application
.ScreenUpdating = True
End With
enditall:
End Sub
Sub Monday()
If Time > TimeSerial(14, 8, 0) Then
If Time < TimeSerial(15, 0, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 8"
End If
End If
If Time > TimeSerial(13, 10, 0) Then
If Time < TimeSerial(14, 2, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 7"
End If
End If
If Time > TimeSerial(12, 12, 0) Then
If Time < TimeSerial(13, 4, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 6"
End If
End If
If Time > TimeSerial(11, 14, 0) Then
If Time < TimeSerial(12, 6, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 5"
End If
End If
If Time > TimeSerial(10, 16, 0) Then
If Time < TimeSerial(11, 8, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 4"
End If
End If
If Time > TimeSerial(9, 8, 0) Then
If Time < TimeSerial(10, 10, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 3"
End If
End If
If Time > TimeSerial(8, 8, 0) Then
If Time < TimeSerial(9, 2, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 2"
End If
End If
If Time > TimeSerial(7, 10, 0) Then
If Time < TimeSerial(8, 2, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 1"
End If
End If
If Time > TimeSerial(6, 0, 0) Then
If Time < TimeSerial(7, 9, 59) Then
Sheets("sheet1").Range("G" & n).Value = "Before School"
End If
End If
If Time > TimeSerial(15, 0, 1) Then
If Time < TimeSerial(17, 0, 0) Then
Sheets("sheet1").Range("G" & n).Value = "After School"
End If
End If 'Monday Period
End Sub
Sub Tuesday()
If Time > TimeSerial(14, 8, 0) Then
If Time < TimeSerial(15, 0, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 8"
End If
End If
If Time > TimeSerial(13, 10, 0) Then
If Time < TimeSerial(14, 2, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 7"
End If
End If
If Time > TimeSerial(12, 12, 0) Then
If Time < TimeSerial(13, 4, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 6"
End If
End If
If Time > TimeSerial(11, 14, 0) Then
If Time < TimeSerial(12, 6, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 5"
End If
End If
If Time > TimeSerial(10, 16, 0) Then
If Time < TimeSerial(11, 8, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 4"
End If
End If
If Time > TimeSerial(9, 8, 0) Then
If Time < TimeSerial(10, 10, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 3"
End If
End If
If Time > TimeSerial(8, 8, 0) Then
If Time < TimeSerial(9, 2, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 2"
End If
End If
If Time > TimeSerial(7, 10, 0) Then
If Time < TimeSerial(8, 2, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 1"
End If
End If
If Time > TimeSerial(6, 0, 0) Then
If Time < TimeSerial(7, 9, 59) Then
Sheets("sheet1").Range("G" & n).Value = "Before School"
End If
End If
If Time > TimeSerial(15, 0, 1) Then
If Time < TimeSerial(17, 0, 0) Then
Sheets("sheet1").Range("G" & n).Value = "After School"
End If
End If
'Tuesday Period
End Sub
Sub Wednesday()
If Time > TimeSerial(11, 2, 0) Then
If Time < TimeSerial(12, 30, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 8"
End If
End If
If Time > TimeSerial(9, 31, 0) Then
If Time < TimeSerial(10, 56, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 3"
End If
End If
If Time > TimeSerial(8, 0, 0) Then
If Time < TimeSerial(9, 25, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 1"
End If
End If
If Time > TimeSerial(7, 10, 0) Then
If Time < TimeSerial(7, 55, 0) Then
Sheets("sheet1").Range("G" & n).Value = "ACCESS Time"
End If
End If
'commented out due to schedule change
'If Time > WPer6S Then
' If Time < WPer6E Then
' sheets("sheet1").range("G" & N).Value = "Period 6"
' End If
'End If
'If Time > WPer4S Then
' If Time < WPer4E Then
' sheets("sheet1").range("G" & N).Value = "Period 4"
' End If
'End If
'If Time > TimeSerial(8, 0, 0) Then
' If Time < TimeSerial(9, 25, 0) Then
' sheets("sheet1").range("G" & N).Value = "Period 2"
' End If
'End If
If Time > TimeSerial(6, 0, 0) Then
If Time < TimeSerial(7, 9, 59) Then
Sheets("sheet1").Range("G" & n).Value = "Before School"
End If
End If
If Time > TimeSerial(12, 30, 1) Then
If Time < TimeSerial(17, 0, 0) Then
Sheets("sheet1").Range("G" & n).Value = "After School"
End If
End If
'Wednesday Period
End Sub
Sub Thursday()
If Time > TimeSerial(13, 18, 0) Then
If Time < TimeSerial(15, 0, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 8"
End If
End If
If Time > TimeSerial(11, 47, 0) Then
If Time < TimeSerial(13, 12, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 6"
End If
End If
If Time > TimeSerial(10, 16, 0) Then
If Time < TimeSerial(11, 41, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 5"
End If
End If
If Time > TimeSerial(8, 45, 0) Then
If Time < TimeSerial(10, 10, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 4"
End If
End If
If Time > TimeSerial(7, 10, 0) Then
If Time < TimeSerial(8, 39, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 1"
End If
End If
'commented out due to change in schedule
'If Time > TPer7S Then
' If Time < TPer7E Then
' sheets("sheet1").range("G" & N).Value = "Period 7"
' End If
'End If
'If Time > TimeSerial(10, 16, 0) Then
' If Time < TimeSerial(11, 41, 0) Then
' sheets("sheet1").range("G" & N).Value = "Period 5"
' End If
'End If
'If Time > TPer3S Then
' If Time < TPer3E Then
' sheets("sheet1").range("G" & N).Value = "Period 3"
' End If
'End If
'If Time > TimeSerial(7, 10, 0) Then
' If Time < TimeSerial(8, 39, 0) Then
' sheets("sheet1").range("G" & N).Value = "Period 1"
' End If
'End If
If Time > TimeSerial(6, 0, 0) Then
If Time < TimeSerial(7, 9, 59) Then
Sheets("sheet1").Range("G" & n).Value = "Before School"
End If
End If
If Time > TimeSerial(15, 0, 1) Then
If Time < TimeSerial(17, 0, 0) Then
Sheets("sheet1").Range("G" & n).Value = "After School"
End If
End If
'Thursday Period
End Sub
Sub Friday()
If Time > TimeSerial(14, 8, 0) Then
If Time < TimeSerial(15, 0, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 8"
End If
End If
If Time > TimeSerial(13, 10, 0) Then
If Time < TimeSerial(14, 2, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 7"
End If
End If
If Time > TimeSerial(12, 12, 0) Then
If Time < TimeSerial(13, 4, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 6"
End If
End If
If Time > TimeSerial(11, 14, 0) Then
If Time < TimeSerial(12, 6, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 5"
End If
End If
If Time > TimeSerial(10, 16, 0) Then
If Time < TimeSerial(11, 8, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 4"
End If
End If
If Time > TimeSerial(9, 8, 0) Then
If Time < TimeSerial(10, 10, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 3"
End If
End If
If Time > TimeSerial(8, 8, 0) Then
If Time < TimeSerial(9, 2, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 2"
End If
End If
If Time > TimeSerial(7, 10, 0) Then
If Time < TimeSerial(8, 2, 0) Then
Sheets("sheet1").Range("G" & n).Value = "Period 1"
End If
End If
If Time > TimeSerial(6, 0, 0) Then
If Time < TimeSerial(7, 9, 59) Then
Sheets("sheet1").Range("G" & n).Value = "Before School"
End If
End If
If Time > TimeSerial(15, 0, 1) Then
If Time < TimeSerial(17, 0, 0) Then
Sheets("sheet1").Range("G" & n).Value = "After School"
End If
End If
'Friday Period
End Sub