SUNLIFE2009
XLDnaute Nouveau
Bonjour,
j'aurais besoin d'assistance pour m'aider à afficher en lignes superposées dans une msgbox le résultat d'une recherche. Actuellement mon code affiche les données les unes à côté des autres, mais dans le but de faciliter la lecture, pouvez-vous m'aider à modifier le code, afin d'avoir chaque résultat l'un au dessus de l'autre.
Voici mon code :
Set Coll = New Collection
With Sheets("Ottawa NG QA Total")
For R = .Range("E702").End(xlUp).Row To 2 Step -1
If .Cells(R, 5).Value = " " Then
On Error Resume Next
Coll.Add .Cells(R, 3), CStr(.Cells(R, 3))
On Error GoTo 0
End If
Next R
If Coll.Count = 0 Then MsgBox "All TOAs are existing !", vbCritical, "Checking Data": Exit Sub
For R = 1 To Coll.Count
If R = 1 Then
TextMsg = Coll(R)
Else
TextMsg = TextMsg & " - " & Coll(R)
End If
Next R
MsgBox "Missing TOA :" & " " & TextMsg, vbCritical, "Checking Data"
End With
J'ai bien vu une affaire de chr(13), mais je n'arrive pas à l'appliquer.
Merci pour votre aide.
Laurent.
j'aurais besoin d'assistance pour m'aider à afficher en lignes superposées dans une msgbox le résultat d'une recherche. Actuellement mon code affiche les données les unes à côté des autres, mais dans le but de faciliter la lecture, pouvez-vous m'aider à modifier le code, afin d'avoir chaque résultat l'un au dessus de l'autre.
Voici mon code :
Set Coll = New Collection
With Sheets("Ottawa NG QA Total")
For R = .Range("E702").End(xlUp).Row To 2 Step -1
If .Cells(R, 5).Value = " " Then
On Error Resume Next
Coll.Add .Cells(R, 3), CStr(.Cells(R, 3))
On Error GoTo 0
End If
Next R
If Coll.Count = 0 Then MsgBox "All TOAs are existing !", vbCritical, "Checking Data": Exit Sub
For R = 1 To Coll.Count
If R = 1 Then
TextMsg = Coll(R)
Else
TextMsg = TextMsg & " - " & Coll(R)
End If
Next R
MsgBox "Missing TOA :" & " " & TextMsg, vbCritical, "Checking Data"
End With
J'ai bien vu une affaire de chr(13), mais je n'arrive pas à l'appliquer.
Merci pour votre aide.
Laurent.