Option Explicit

Private Sub Workbook_Open()
   GetExpires 'Don't overload an Event Sub
End Sub
Private Sub GetExpires()
   'Your code should all be in this Sub
End Sub
I don't know why you are checking very cell in A6 to D313, when all you need is column C