Thread: Email on save
View Single Post
  #17   Report Post  
Posted to microsoft.public.excel.programming
Paul Doucette Paul Doucette is offline
external usenet poster
 
Posts: 40
Default Email on save

On Friday, July 29, 2016 at 3:43:28 PM UTC-4, Claus Busch wrote:
Hi Paul,

Am Fri, 29 Jul 2016 12:12:31 -0700 (PDT) schrieb Paul Doucette:

Yes, that's correct. A through J in that order.


in a standard module:

Public LRowOld As Long
Sub RowCheck()
LRowOld = Cells(Rows.Count, 1).End(xlUp).Row
End Sub

In module of Sheet1:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then RowCheck
End Sub

In module of workbook:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim LRow As Long

LRow = Sheets("Sheet1").UsedRange.Rows.Count
If LRow = LRowOld Then Exit Sub
'Insert here the code to create your email
End Sub


Regards
Claus B.
--
Windows10
Office 2016


THANKS! Will try it as soon as I can get in the workbook on my own!