Hello there, I've seen other threads demonstrating that this is possible. I'm wondering if it is possible for a range of worksheets and to stop it happening on any that aren't listed?
I've added this to "ThisWorkbook"
I know I've got the code wrong, because I am getting an error about sh not being defined and am looking for corrections to get it working please:
Thank you very much.
I've added this to "ThisWorkbook"
I know I've got the code wrong, because I am getting an error about sh not being defined and am looking for corrections to get it working please:
VBA Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Select Case Sh.Name
Case "HA", "Ls", "Dev"
.Range("A:E").Select '#
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Introduction = "Hello NAME, the worksheet has been updated by " & Environ("USERNAME") & " at " & Format(Now(), "ddd dd mmm yy hh:mm")
.Item.To = "MYEMAILADDRESS"
.Item.Subject = "Worksheet Updated"
.Item.display
'.Item.send
End With
Case Else
ActiveWorkbook.EnvelopeVisible = False
End Sub
Thank you very much.