Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
Validation - Ensure Cell values match
Thanks for your help, that work.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using Match function with duplicate values in an array | Excel Worksheet Functions | |||
find a cell matching separate column and row values | Excel Worksheet Functions | |||
Replacing Linked Cell Values w/ Current Values | Excel Worksheet Functions | |||
How can I match up values from 2 sheets and info in adjoining cell | Excel Discussion (Misc queries) | |||
set hypothetical values for a cell | Excel Worksheet Functions |