Denne makroen sender hvert ark til en person.
- Lag en ny arbeidsbok med arket.
- Lagre arbeidsboken før du sender den
- Slett filen fra harddisken etter at den er sendt.
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 , "dd-mm-åå") & "" og format (tid, "h-mm-ss") ActiveWorkbook.SaveAs "Del av" & ThisWorkbook.Name _ & "" & strDate & ".xls" ActiveWorkbook.SendMail ActiveSheet.Range ("a1"). Verdi, _ "Dette er emnelinjen" ActiveWorkbook.ChangeFileAccess xlReadOnly Kill ActiveWorkbook.FullName ActiveWorkbook.Close False End If Next sh Application.ScreenUpdating = True End Sub