#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Validation

Dear sir
First I would like to thank you about this web-site it's so helpful,
If u can help me, I want to make a program on oracle and excel is part
of it I will give u an example about what I need to do in excel:
Suppose I have 4 cells A1 B1 C1 D1, in D1 there is a fixed value lets
say 10
I want a restriction that limit the user not to enter a value in A1 B1
C1 cells but less than or equal the value in D1 that's men
A1+B1+C1<=D1
And if the user enter a value in one of the three cells that make the
summation of three cells grater than D1=10, then must display a
message and return the cursor to the cell that make the error and
color it with red
That's all I need, I will be grateful if u help me in this issue
Best regards
Mohad Haddad
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Validation

Hi Mohad,
You want an Event macro, since you are probably familiar
with macros I will just point you this site. Since I'm leaving now.
http://www.mvps.org/dmcritchie/excel/event.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Mohad Haddad" wrote in message om...
Dear sir
First I would like to thank you about this web-site it's so helpful,
If u can help me, I want to make a program on oracle and excel is part
of it I will give u an example about what I need to do in excel:
Suppose I have 4 cells A1 B1 C1 D1, in D1 there is a fixed value lets
say 10
I want a restriction that limit the user not to enter a value in A1 B1
C1 cells but less than or equal the value in D1 that's men
A1+B1+C1<=D1
And if the user enter a value in one of the three cells that make the
summation of three cells grater than D1=10, then must display a
message and return the cursor to the cell that make the error and
color it with red
That's all I need, I will be grateful if u help me in this issue
Best regards
Mohad Haddad



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Validation

Hi Mohad,
Directions to install:
Unlike regular macros which are installed in regular modules,
Worksheet Events are installed with the worksheet by
right-clicking on the sheettab, choose 'view code', and then
paste in your macro.

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
' If Target.Row < 1 Then Exit Sub 'use to limit to row 1
If Target.Column 4 Then Exit Sub 'limited to A:D columns
Intersect(Range("A:D"), Rows(Target.Row)).Interior.ColorIndex = xlNone
Intersect(Range("A:D"), Rows(Target.Row)).Font.ColorIndex = xlAutomatic
Dim a As Double
On Error Resume Next
a = 40
a = Target.Offset(0, 1 - Target.Column) + _
Target.Offset(0, 2 - Target.Column) + _
Target.Offset(0, 3 - Target.Column)
If a < Target.Offset(0, 4 - Target.Column) Or a 20 Then
Target.Font.ColorIndex = 3
If IsEmpty(Target) Then Target.Interior.ColorIndex = 6
End If
End Sub

Whether English is you native language or not please don't
misspell words that you know how to spell it makes it harder
for everyone to read. For many people in this newsgroup
English is not their native language.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"David McRitchie" wrote in message ...
Hi Mohad,
You want an Event macro, since you are probably familiar
with macros I will just point you this site. Since I'm leaving now.
http://www.mvps.org/dmcritchie/excel/event.htm

"Mohad Haddad" wrote in message om...
Dear sir
First I would like to thank you about this web-site it's so helpful,
If u can help me, I want to make a program on oracle and excel is part
of it I will give u an example about what I need to do in excel:
Suppose I have 4 cells A1 B1 C1 D1, in D1 there is a fixed value lets
say 10
I want a restriction that limit the user not to enter a value in A1 B1
C1 cells but less than or equal the value in D1 that's men
A1+B1+C1<=D1
And if the user enter a value in one of the three cells that make the
summation of three cells grater than D1=10, then must display a
message and return the cursor to the cell that make the error and
color it with red
That's all I need, I will be grateful if u help me in this issue
Best regards
Mohad Haddad





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
Validation Data using Validation Table cell range..... Dermot Excel Discussion (Misc queries) 16 January 5th 10 09:35 PM
data validation invalid in dynamic validation list ilia Excel Worksheet Functions 0 November 7th 06 12:54 PM
Validation (Drop down list vs simple text length validation) Bob Phillips[_6_] Excel Programming 2 April 27th 04 07:47 PM
Validation (Drop down list vs simple text length validation) Jason Morin[_2_] Excel Programming 1 April 27th 04 04:56 PM
Validation (Drop down list vs simple text length validation) Pete McCosh Excel Programming 0 April 27th 04 03:49 PM


All times are GMT +1. The time now is 03:48 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"