Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have 2 cells (A1.A2) where numbers will be entered.
Once the user goes to cell A3, I need VBA code to check to ensure that A1+A2 = 100, and if they do not, to show an error message saying they do not (I know how to do the messagebox, but when I go to Cell A3, nothing happens even tho A1+A2 does not = 100). What I have so far is the following (which is in the specific worksheet code window): Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "A3" Then If Range("A1").Value + Range("A2").Value <100 Then MsgBox ("Error") End If End If End Sub I need code for this, not data validation or formuals. Thanks for any help you can provide....pc |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Checking on two values | Excel Discussion (Misc queries) | |||
Checking ALL values in a range | Excel Discussion (Misc queries) | |||
Checking Cell Values Row-by-Row | Excel Programming | |||
checking for missing values | Excel Programming | |||
checking values in a cel | Excel Programming |