Function expiryIssue(rng As Range) As String
Application.Volatile
Dim dte1 As Range
Dim dte2 As Range
Dim status As String
Set dte1 = rng.Cells(1, 1)
Set dte2 = rng.Cells(1, 2)
status = rng.Cells(1, 3)
If status <> "Expired" And status <> "Cancelled" And status <> "Replaced" Then
' If there is no Proposed or Approved expiry date
If dte2 = "" And dte1 = "" Then
expiryIssue = "Missing expiry dates"
Else
'If there is no Approved Expiry date and the Proposed Expiry date is within 60 days of todays date
If dte2 = "" Then
If dte1 < Date + 60 Then expiryIssue = "Review proposed expiry date"
Else
'If the Approved Expiry date is older than today's date
If dte1 = "" Then
If dte2 < Date Then expiryIssue = "Issue"
Else
If dte2 < Date Then expiryIssue = "Issue"
End If
End If
End If
End If
End Function
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.