TheBAnalyst
New Member
- Joined
- Aug 2, 2018
- Messages
- 3
I have written a macro that filters an excel sheet and emails the results to an email recipient - it uses "Send sheet" rather then send as an attachment. The problem I'm having is that when the email recipient replies to me, the sheet appears unfiltered and is causing confusion (I am sending individual emails to people requesting responses no specific lines only - when they click reply, the sheet unfilters and causes too many issues/questions)
The code is as follows:
Filter Macro
'
Application.DisplayAlerts = False
'
ActiveSheet.Range("$A$1:$Z$425").AutoFilter Field:=9, Criteria1:="<>"
ActiveSheet.Range("$A$1:$Z$425").AutoFilter Field:=7, Criteria1:= _
"Mail Recipient"
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Introduction = "XXXX - The attached are activities assigned to you. Please let me know if there are actions to close/update by midday today?."
.Item.To = "mail.recipient@work.co.uk"
.Item.Subject = " Actions"
.Item.Send
End With
can anyone help with an extra line or 5 of code that will prevent the user from unfiltering (or more importantly, stop it unfiltering automatically when they hit "reply" in outlook)
The code is as follows:
Filter Macro
'
Application.DisplayAlerts = False
'
ActiveSheet.Range("$A$1:$Z$425").AutoFilter Field:=9, Criteria1:="<>"
ActiveSheet.Range("$A$1:$Z$425").AutoFilter Field:=7, Criteria1:= _
"Mail Recipient"
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Introduction = "XXXX - The attached are activities assigned to you. Please let me know if there are actions to close/update by midday today?."
.Item.To = "mail.recipient@work.co.uk"
.Item.Subject = " Actions"
.Item.Send
End With
can anyone help with an extra line or 5 of code that will prevent the user from unfiltering (or more importantly, stop it unfiltering automatically when they hit "reply" in outlook)