Show me the two codes you want to run when Workbook opens
Sub correctvalue()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
Set ws = ThisWorkbook.Sheets("Sheet1")
'Const Text2Find = "AM"
Dim cel As Range
For Each cel In ws.UsedRange.Columns("A").Cells
If InStr(cel.Value, " AM") > 0 Then
cel.Offset(0, 2) = 1
ElseIf InStr(cel.Value, " PM") > 0 Then
cel.Offset(0, 2) = 1
ElseIf InStr(cel.Value, " 2018") > 0 Then
cel.Offset(0, 2) = 0
Else
cel.Offset(0, 2).ClearContents
End If
Next cel
Next ws
End Sub
Sub finalvalue()
For Each cell In Range("C:C")
Range("C1").Value = "CORRECT"
Range("D1").Value = "FINAL"
If cell = "" And cell.Offset(2, 0) = "" Then Exit For
If IsEmpty(cell.Value) Or cell.Value = "" Or cell.Row = Cells(Rows.Count, "C").End(xlUp).Row Then cell.Offset(0, 1).Value = "x"
Next cell
For Each cell In Range("D:D")
If cell.Row = Cells(Rows.Count, "C").End(xlUp).Row Then
cell.Value = ""
Exit For
End If
If cell.Value = "x" Then
Debug.Print cell.Address(0, 0)
nextx = Range("D:D").Find("x", Range(cell.Address(0, 0))).Offset(0, -1).Address(0, 0)
cell.Value = WorksheetFunction.Sum(Range(cell.Offset(0, -1).Address(0, 0) & ":" & nextx))
End If
Next cell
End Sub