Toto makro odošle každý list jednej osobe.
- Vytvorte nový zošit pomocou hárka.
- Pred odoslaním zošita si ho uložte
- Po odoslaní odstráňte súbor z pevného disku.
Sub Mail_every_Worksheet () Dim strDate As String Dim sh As Worksheet Application.ScreenUpdating = False For each sh In ThisWorkbook.Worksheets If sh.Range ("a1"). Value Like "*@*" Then sh.Copy strDate = Format (Date (Date) "dd-mm-rr") & "" & formát (čas, "h-mm-ss") ActiveWorkbook.SaveAs "súčasť" & ThisWorkbook.Name _ & "" & strDate & ".xls" ActiveWorkbook.SendMail ActiveSheet.Range ("a1"). Hodnota, _ "Toto je riadok predmetu" ActiveWorkbook.ChangeFileAccess xlReadOnly Kill ActiveWorkbook.FullName ActiveWorkbook.Close False End If Next sh Application.ScreenUpdating = True End Sub