Private
Sub
email1_Click()
Dim
rng
As
Range
Dim
last
As
Long
Dim
Heute
As
String
Heute = Format(
Date
,
"dd/mm/yyyy"
)
last = ActiveSheet.Cells(Rows.Count, 1).
End
(xlUp).Row
ActiveSheet.Range(
"A1:F"
& last).AutoFilter Field:=1, Criteria1:=Heute, VisibleDropDown:=
False
Set
rng = ActiveSheet.Range(
"A1:F"
& last).SpecialCells(xlCellTypeVisible)
rng.
Select
ActiveWorkbook.EnvelopeVisible =
True
Application.DisplayAlerts =
False
With
ActiveSheet.MailEnvelope
.Introduction =
"Anbei die Auftragsliste Groz-Beckert. "
.Item.
To
=
"xxxxxxxxx"
.Item.Subject = ActiveSheet.Name &
" vom "
&
Date
.Item.Display
.Item.Send
End
With
Application.DisplayAlerts =
True
ActiveSheet.ShowAllData
ActiveWorkbook.EnvelopeVisible =
False
MsgBox
"Nachricht wurde versendet"
Worksheets(
"Data"
).Activate
txtName =
""
txtName.SetFocus
End
Sub