Create a public variable, like
Public Changed as Boolean
and in the code for the ThisWorkbook object, do something like:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Changed = True
End Sub
In the BeforeClose event, test the value of Changed:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Changed then
'do your thing here
End If
End Sub