Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Checking for changes.

Does anyone know of a way that I can check to see if my workbook has been
altered before it's closed?

I need to do this because I have a workbook where users record serial
numbers allocated to components, but sometime they look up the next number
and then forget to update the workbook with the numbers allocated, the result
being that the next person uses the same numbers again.

I'd like to create some sort of warning box if the workbook has been opened
but no updates have been made.

Not sure if this is possible, but I'd appreciate any ideas anyone lse may have

Thanks

Neil
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Checking for changes.

Add code similar to this to the thisworkbook module (Right click the Excel
Icon in the upper left corner of the Excel window - Select View Code -
Paste the attached code)

Option Explicit
Public blnChanged As Boolean

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If blnChanged = True Then _
MsgBox "The workbook was changed"
End Sub

Private Sub Workbook_Open()
blnChanged = False
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
blnChanged = True
End Sub

--
HTH...

Jim Thomlinson


"Neil" wrote:

Does anyone know of a way that I can check to see if my workbook has been
altered before it's closed?

I need to do this because I have a workbook where users record serial
numbers allocated to components, but sometime they look up the next number
and then forget to update the workbook with the numbers allocated, the result
being that the next person uses the same numbers again.

I'd like to create some sort of warning box if the workbook has been opened
but no updates have been made.

Not sure if this is possible, but I'd appreciate any ideas anyone lse may have

Thanks

Neil

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spell Checking with checking cell notes jfitzpat Excel Discussion (Misc queries) 0 August 8th 07 10:26 PM
Checking and IF ? mohamadhafiz Excel Worksheet Functions 5 June 26th 07 11:04 PM
Day Checking K1KKKA Excel Discussion (Misc queries) 4 January 30th 07 08:19 PM
Add checking Pat Excel Worksheet Functions 5 December 17th 04 08:25 PM
#NUM checking Lp12 Excel Programming 1 December 5th 04 07:05 AM


All times are GMT +1. The time now is 03:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"