I have a code that check all task during opening a project however it displays a warning for each individual task in MSP. What I would like is a message box that shows all found tasks at once.
Any suggestions anyone? Thanks.
[vba]Sub XPLN_OSCH()
Dim T As Integer
Dim Msg, Style, Title, Response
With ActiveProject
For T = 1 To .Tasks.Count
If .Tasks(T).Summary = True Then
If InStr(.Tasks(T).EnterpriseText23, "XPLN") > 0 Then
If .Tasks(T).EnterpriseFlag1 = True Then
Msg = "Order Nr " & .Tasks(T).EnterpriseText1 & " has User Status ""XPLN"" and On Schedule is ""Yes""" & Chr(13) & Chr(13) & "Please change On Schedule into ""No"" and/or contact the responsible Job Leader to discuss timelines" ' Define message.
Style = vbOKOnly + vbCritical + vbDefaultButton2
Title = "Check MSP"
Response = MsgBox(Msg, Style, Title)
End If
End If
End If
Next T

End With
End Sub[/vba]