1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub EnvoiCa()
'Je récupère la date du tableau dans une cellule donnée
Sujet = ActiveWorkbook.Sheets("CARAYON").Range("A2").Value
'Mail1
Sheets("CARAYON").Range("A1:AA13").Select
ActiveWorkbook.EnvelopeVisible = True
With Sheets("CARAYON").MailEnvelope
.Introduction = "Bonjour," & Chr(13) & Chr(13) & "Veuillez trouver ci dessous le tableau"
.Item.To = "toto@toto.com"
.Item.CC = "pouet@pouet.com"
.Item.Subject = "Chiffre du " & Sujet
Sleep 3000
.Item.Send
End With
'Mail2
Sheets("CARAYON").Range("A15:AA41").Select
ActiveWorkbook.EnvelopeVisible = True
With Sheets("CARAYON").MailEnvelope
.Introduction = "Bonjour," & Chr(13) & Chr(13) & "Veuillez trouver ci dessous le tableau"
.Item.To = "toto@toto.com"
.Item.CC = "pouet@pouet.com"
.Item.Subject = "Chiffre du " & Sujet
Sleep 3000
.Item.Send
End With
' Mail3
Sheets("CARAYON").Range("A43:AA74").Select
ActiveWorkbook.EnvelopeVisible = True
With Sheets("CARAYON").MailEnvelope
.Introduction = "Bonjour," & Chr(13) & Chr(13) & "Veuillez trouver ci dessous le tableau"
.Item.To = "toto@toto.com"
.Item.CC = "pouet@pouet.com"
.Item.Subject = "Chiffre du " & Sujet
Sleep 3000
.Item.Send
End With
'Je désactive les alertes, je supprime mon onglet CARAYON et je retourne sur mon onglet Feuil1
Application.DisplayAlerts = False
Sheets("CARAYON").Delete
Application.DisplayAlerts = True
Sheets("Feuil1").Select
End Sub |
Partager