LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Checking to See if Range Values Add up to 100

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
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
Checking on two values Johannes B. Excel Discussion (Misc queries) 4 April 22nd 05 06:49 PM
Checking ALL values in a range nospaminlich Excel Discussion (Misc queries) 13 February 10th 05 09:29 AM
Checking Cell Values Row-by-Row News Reader Excel Programming 1 November 25th 04 02:20 AM
checking for missing values Jerry[_17_] Excel Programming 4 February 16th 04 09:34 PM
checking values in a cel solo_razor[_8_] Excel Programming 2 September 18th 03 01:37 PM


All times are GMT +1. The time now is 08:38 AM.

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"