Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Create a warning message


Cell validation only works when data is entered directly in a cell. I want to
recreate this effect so that Excel displays a pop up message when the
calculated value of a cell falls below £100. The cell in question is
calculating the sum of three other cells on the worksheet and is formatted as
currency.

Cheers :)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Create a warning message


Hi,

Because it is a calculated value you can use the worksheet calculate event

Private Sub Worksheet_Calculate()
If Range("A1").Value < 100 Then
MsgBox "Cell value " & Range("A1").Value
End If
End Sub

Mike

"Stuart M" wrote:

Cell validation only works when data is entered directly in a cell. I want to
recreate this effect so that Excel displays a pop up message when the
calculated value of a cell falls below £100. The cell in question is
calculating the sum of three other cells on the worksheet and is formatted as
currency.

Cheers :)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Create a warning message


Somthing like the below. Right click sheet tabView Code and paste the below
code..A1:C1 is the range you enter the values...and D1 is the cell with
formula. Adjust to suit..

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False

If Not Application.Intersect(Target, Range("A1:C1")) Is Nothing Then
If Range("D1") < 100 Then
MsgBox "Total of A1:C1 should be more than 100"
Target.Value = 0: Target.Activate
End If
End If

Application.EnableEvents = True
End Sub
--
If this post helps click Yes
---------------
Jacob Skaria


"Stuart M" wrote:

Cell validation only works when data is entered directly in a cell. I want to
recreate this effect so that Excel displays a pop up message when the
calculated value of a cell falls below £100. The cell in question is
calculating the sum of three other cells on the worksheet and is formatted as
currency.

Cheers :)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Create a warning message


you might also consider using Conditional Formatting - ie let the cell turn
red or something to make it really visible

"Stuart M" <Stuart wrote in message
...
Cell validation only works when data is entered directly in a cell. I want
to
recreate this effect so that Excel displays a pop up message when the
calculated value of a cell falls below £100. The cell in question is
calculating the sum of three other cells on the worksheet and is formatted
as
currency.

Cheers :)


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Create a warning message


Hi Mike thanks for the answer. Its the value returned in the Sum cell that
must be used for validation - i.e. if it shows <£100 then show the warning
message.

The users input data somewhere else which is summed in a different cell so I
want the summed cell to display a warning if it is less than a given amount.

Any ideas?

"Mike H" wrote:

Hi,

Because it is a calculated value you can use the worksheet calculate event

Private Sub Worksheet_Calculate()
If Range("A1").Value < 100 Then
MsgBox "Cell value " & Range("A1").Value
End If
End Sub

Mike

"Stuart M" wrote:

Cell validation only works when data is entered directly in a cell. I want to
recreate this effect so that Excel displays a pop up message when the
calculated value of a cell falls below £100. The cell in question is
calculating the sum of three other cells on the worksheet and is formatted as
currency.

Cheers :)



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Create a warning message


Hi Jacob thanks for the answer. I couldn't get it to work at all. I just want
a warning displayed if the value is below a certain monetary figure. The
simple formula in that cell is =SUM(I46:J48)

so if that result is 100 show the warning message

Any ideas?

"Jacob Skaria" wrote:

Somthing like the below. Right click sheet tabView Code and paste the below
code..A1:C1 is the range you enter the values...and D1 is the cell with
formula. Adjust to suit..

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False

If Not Application.Intersect(Target, Range("A1:C1")) Is Nothing Then
If Range("D1") < 100 Then
MsgBox "Total of A1:C1 should be more than 100"
Target.Value = 0: Target.Activate
End If
End If

Application.EnableEvents = True
End Sub
--
If this post helps click Yes
---------------
Jacob Skaria


"Stuart M" wrote:

Cell validation only works when data is entered directly in a cell. I want to
recreate this effect so that Excel displays a pop up message when the
calculated value of a cell falls below £100. The cell in question is
calculating the sum of three other cells on the worksheet and is formatted as
currency.

Cheers :)

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Create a warning message


Sorry I meant less than < DOH

"Stuart M" wrote:

Hi Jacob thanks for the answer. I couldn't get it to work at all. I just want
a warning displayed if the value is below a certain monetary figure. The
simple formula in that cell is =SUM(I46:J48)

so if that result is 100 show the warning message

Any ideas?

"Jacob Skaria" wrote:

Somthing like the below. Right click sheet tabView Code and paste the below
code..A1:C1 is the range you enter the values...and D1 is the cell with
formula. Adjust to suit..

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False

If Not Application.Intersect(Target, Range("A1:C1")) Is Nothing Then
If Range("D1") < 100 Then
MsgBox "Total of A1:C1 should be more than 100"
Target.Value = 0: Target.Activate
End If
End If

Application.EnableEvents = True
End Sub
--
If this post helps click Yes
---------------
Jacob Skaria


"Stuart M" wrote:

Cell validation only works when data is entered directly in a cell. I want to
recreate this effect so that Excel displays a pop up message when the
calculated value of a cell falls below £100. The cell in question is
calculating the sum of three other cells on the worksheet and is formatted as
currency.

Cheers :)

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Create a warning message


I'm being lazy I know but can you tell me how?

Thnaks. Probably the low-tec way might be best!

"Patrick Molloy" wrote:

you might also consider using Conditional Formatting - ie let the cell turn
red or something to make it really visible

"Stuart M" <Stuart wrote in message
...
Cell validation only works when data is entered directly in a cell. I want
to
recreate this effect so that Excel displays a pop up message when the
calculated value of a cell falls below £100. The cell in question is
calculating the sum of three other cells on the worksheet and is formatted
as
currency.

Cheers :)


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Create a warning message


Select the sum cell. From menu FormatConditional Formatting.

Condition1
CEll value islessthan100
Select a color from 'Format'

If this post helps click Yes
---------------
Jacob Skaria


"Stuart M" wrote:

Sorry I meant less than < DOH

"Stuart M" wrote:

Hi Jacob thanks for the answer. I couldn't get it to work at all. I just want
a warning displayed if the value is below a certain monetary figure. The
simple formula in that cell is =SUM(I46:J48)

so if that result is 100 show the warning message

Any ideas?

"Jacob Skaria" wrote:

Somthing like the below. Right click sheet tabView Code and paste the below
code..A1:C1 is the range you enter the values...and D1 is the cell with
formula. Adjust to suit..

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False

If Not Application.Intersect(Target, Range("A1:C1")) Is Nothing Then
If Range("D1") < 100 Then
MsgBox "Total of A1:C1 should be more than 100"
Target.Value = 0: Target.Activate
End If
End If

Application.EnableEvents = True
End Sub
--
If this post helps click Yes
---------------
Jacob Skaria


"Stuart M" wrote:

Cell validation only works when data is entered directly in a cell. I want to
recreate this effect so that Excel displays a pop up message when the
calculated value of a cell falls below £100. The cell in question is
calculating the sum of three other cells on the worksheet and is formatted as
currency.

Cheers :)

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Create a warning message


see Jacob's reply ... he gives the details

"Stuart M" wrote in message
...
I'm being lazy I know but can you tell me how?

Thnaks. Probably the low-tec way might be best!

"Patrick Molloy" wrote:

you might also consider using Conditional Formatting - ie let the cell
turn
red or something to make it really visible

"Stuart M" <Stuart wrote in message
...
Cell validation only works when data is entered directly in a cell. I
want
to
recreate this effect so that Excel displays a pop up message when the
calculated value of a cell falls below £100. The cell in question is
calculating the sum of three other cells on the worksheet and is
formatted
as
currency.

Cheers :)


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
warning message cufc1210 Excel Discussion (Misc queries) 2 September 30th 09 11:48 PM
How do I create a warning message on a command button lkreeder New Users to Excel 4 February 1st 09 04:52 PM
Warning Message Ewing25 Excel Programming 7 June 11th 08 08:27 PM
Warning Message bollard Excel Worksheet Functions 6 September 12th 07 05:59 PM
How to I get a warning message box shrek Excel Worksheet Functions 3 November 10th 05 12:23 AM


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