Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default Validation - Ensure Cell values match

Hi

I have a spreadsheet, and need to ensure that the value in a number of cells
are the same.

Example
Cell C1 shows the total number of open Problem. Table Two has All Open
Problems by Age with a check Sum in Cell D5. The Value in Cell C1 & D5
should be the same. I would like a warning message to be displayed before
you save or exit the sheet, if the two values are not the same

Is this possible
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Validation - Ensure Cell values match

Try:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
With Worksheets("Sheet1")
If Range("C1") < Range("D5") Then
MsgBox "Error - checksum mismatch" '<=== change to required message
Cancel = True '<=== workbook remains open
End If
End With
End Sub

To insert code:

Alt+F11 to open Visual Basic Editor (VBE)
right click on "Thisworkbook" in VBS project window
Click "View Code"
Copy & paste above code.

HTH

"bluesifi" wrote:

Hi

I have a spreadsheet, and need to ensure that the value in a number of cells
are the same.

Example
Cell C1 shows the total number of open Problem. Table Two has All Open
Problems by Age with a check Sum in Cell D5. The Value in Cell C1 & D5
should be the same. I would like a warning message to be displayed before
you save or exit the sheet, if the two values are not the same

Is this possible

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default Validation - Ensure Cell values match

Thanks for your help, that work.


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
Using Match function with duplicate values in an array Richard Excel Worksheet Functions 3 April 22nd 23 07:45 PM
find a cell matching separate column and row values LQEngineer Excel Worksheet Functions 2 July 26th 06 07:10 AM
Replacing Linked Cell Values w/ Current Values TomCat Excel Worksheet Functions 6 April 10th 06 12:20 PM
How can I match up values from 2 sheets and info in adjoining cell naclu Excel Discussion (Misc queries) 4 February 3rd 06 10:50 PM
set hypothetical values for a cell chris8715 Excel Worksheet Functions 1 February 22nd 05 05:18 PM


All times are GMT +1. The time now is 10:28 AM.

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

About Us

"It's about Microsoft Excel"