KyleJackMorrison
Board Regular
- Joined
- Dec 3, 2013
- Messages
- 107
- Office Version
- 365
- 2021
- 2019
- Platform
- Windows
Right, Hello Guru's,
I have this code, and it alerts me when my Colleagues are 14 days or less away from their course.
The MsgBox asked them if they have booked transport. If the msgbox result clicks yes then i would like the code to no longer show that certain colleagues name again. If they click no, then leave it as each time the worksheet has been opened it'll pop up.
Any help would be much appreciated.
Kind regards,
Kyle
I have this code, and it alerts me when my Colleagues are 14 days or less away from their course.
The MsgBox asked them if they have booked transport. If the msgbox result clicks yes then i would like the code to no longer show that certain colleagues name again. If they click no, then leave it as each time the worksheet has been opened it'll pop up.
Code:
Private Sub Worksheet_Activate_Part2() Dim LRow As Integer
Dim LResponse As Integer
Dim LLName As String
Dim LFName As String
Dim LTitle As String
Dim LDiff As Integer
Dim LDays As Integer
LRow = 6
'Warning - Number of days to check for expiration
LDays = 14
'Check the first 50 rows in column P
While LRow < 30
'Only check for expired certificate if value in column C is not blank
If Len(Sheets("Colleagues").Range("P" & LRow).Value) > 0 Then
LDiff = DateDiff("d", Date, Sheets("Colleagues").Range("P" & LRow).Value)
If (LDiff > 0) And (LDiff <= LDays) Then
'Get name
LTitle = Sheets("Colleagues").Range("D" & LRow).Value
LFName = Sheets("Colleagues").Range("E" & LRow).Value
LLName = Sheets("Colleagues").Range("F" & LRow).Value
LResponse = MsgBox(LTitle & " " & LFName & " " & LLName & " is attending thier course in, " & LDiff & " days." & Chr(13) & "" & Chr(13) & "Have you booked Transport?", vbCritical + vbYesNo, "Warning")
End If
End If
LRow = LRow + 1
Wend
End Sub
Any help would be much appreciated.
Kind regards,
Kyle