Option Explicit
Dim derli%, dercol%
Dim startoutlook As New Outlook.Application
Sub mail()
Set startoutlook = New Outlook.Application
With Sheets(1)
Application.ScreenUpdating = False
derli = .Range("A1").SpecialCells(xlCellTypeLastCell).Row
dercol = .Range("A1").SpecialCells(xlCellTypeLastCell).Column
.Cells(2, 1).Resize(derli + 1, dercol).Copy
End With
Sheets(2).Cells(1, 1).Select
Selection.PasteSpecial Paste:=xlPasteAll, Transpose:=True
Selection.EntireColumn.AutoFit
ActiveWorkbook.EnvelopeVisible = True
With Sheets(2).MailEnvelope
.Introduction = "Bonjour," & Chr(13) & _
"Veuillez trouver ci-dessous la liste des erreurs trouvées à corriger." _
& Chr(13) & Chr(13) & "Cordialement."
.Item.To = "adresse@adresse.fr"
.Item.Subject = "sujet ?"
.Item.Send
End With
ActiveWorkbook.EnvelopeVisible = False
Application.DisplayAlerts = False
Sheets(2).Delete
Sheets(1).Cells(1, 1).Select
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub