Bonsoir Awa, bonsoir le forum,
Pourquoi continuer la boucle quand je jour est touvé ?
Sub Macro1()
Dim wb As Workbook
Dim Ws As Worksheet
Set wb = Workbooks.Open("C:\Users\\Desktop\semaine.xlsx")
For Each Ws In wb.Worksheets
If Ws.Name = JSem(Cells(1, 6)) Then
MsgBox ("on a trouvé le même jour")
wb.Close
Exit Sub
End If
Next Ws
End Sub
ou
Sub Macro1()
Dim wb As Workbook
Dim Ws As Worksheet
Set wb = Workbooks.Open("C:\Users\\Desktop\semaine.xlsx")
For Each Ws In wb.Worksheets
If Ws.Name = JSem(Cells(1, 6)) Then
MsgBox ("on a trouvé le même jour")
Exit For
End If
Next Ws
wb.Close
End Sub