Option Explicit
Public client As Range, List, clientAdresse As String, jour
Sub Choix_Client()
Dim clientcherche As String
Dim i As Single, r As String, r2 As String
jour = ""
clientcherche = InputBox("Client")
Set client = Feuil4.Columns(1).SpecialCells(xlCellTypeVisible).SpecialCells(xlCellTypeConstants).Find(clientcherche)
clientAdresse = client.Offset(, 1)
For i = 2 To 5
If Cells(i, 1) Like "Client " & clientcherche & "*" Then
r = Cells(i, 1) & ";"
r2 = Cells(i, 2) & ";"
List = List & r
jour = jour & Chr(10) & r2
End If
Next i
Call mail
End Sub
Sub mail()
Dim Myoutlook As Object
Dim MyItem As Object
Dim List As String, Attache As String, Attache2 As String, Sujet As String
Dim f As Worksheet, f1 As Worksheet, Body As String
Set Myoutlook = CreateObject("Outlook.Application")
Set MyItem = Myoutlook.CreateItem(0)
Sujet = "Bla bla bla" ' & Feuil1.Range("A1")
Body = "Vos jours de réservation sont :" & Chr(10) & jour
With MyItem
.To = clientAdresse
.Subject = Sujet
.Body = Body
suite:
.Display
' '.Send
End With
End Sub