Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub UserForm_Initialize() ComboBox1.RowSource = ("code!B2:B135") ComboBox2.RowSource = ("code!C2:C135") ComboBox1.ListIndex = -1 ComboBox2.ListIndex = -1 End Sub
Private Sub ComboBox1_Change() ComboBox2.ListIndex = ComboBox1.ListIndex End Sub
Sub macro1()
Dim OutlookApp As New Outlook.Application
Dim Mess As Outlook.mailItem, Desti As String
Dim StrSign As String
Desti = [E8]
Set OutlookApp = Outlook.Application
Set Mess = OutlookApp.CreateItem(olMailItem)
With Mess
.Display
.Subject = "Expédition du SAV N° " & [B8]
.HTMLBody = "<HTML>
Bonjour, votre SAV N° " & [B8] & " </gras>" & " vient d'être expédié ce jour par " & [D8] & "
" & _
"
" & _
"Ceci est un mail automatique, merci de ne pas y répondre." & _
"
" & _
"pour toute autres informations concernant un SAV/commande express merci de contacter Marc au :
02-33-58-95-99 ou marc.aluglass@gmail.com" _
+ .HTMLBody
.Recipients.Add Desti
End With
End Sub
Private Sub CommandButton1_Click() If Sheets("Feuil2").Range("E8").Value <> "" Then Rows("8:8").Select Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromRightOrBelow With Sheets("Feuil2") .Range("B8").Value = sav.Value 'numéro .Range("C8").Value = txtDate.Value 'date .Range("E8").Value = mail.Value 'mail If Me.transport1.Value = True Then .Range("D8").Value = Me.transport1.Caption End If If Me.transport2.Value = True Then .Range("D8").Value = Me.transport2.Caption End If If Me.transport3.Value = True Then .Range("D8").Value = Me.transport3.Caption End If If Me.transport4.Value = True Then .Range("D8").Value = Me.transport4.Caption End If If Me.transport5.Value = True Then .Range("D8").Value = Me.transport5.Caption End If End With Call macro1 Unload UserForm1 Else MsgBox "Erreur" End If End Sub
If [E8].Value = "" Then 'vérifie que la case E8 contient bien l'adresse mail
Exit Sub 'interrompt la macro d'envoie de mail, l'userForm continue son travail
End If