Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default How to create msg box if a cell contains value < 0

Greeting,
I have a column has 5 cells which they have function (sum) depend on other
cells. In those cells I what to make a msgbox warns the user that the value
of one of them or all is under 0 and the user should input other data . i.e.
if E1 has the value of sum A1and B1, a msg box appears and warns.
how can I do that?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default How to create msg box if a cell contains value < 0

On 17 Jan., 20:52, ghost wrote:
Greeting,
I have a column has 5 cells which they have function (sum) depend on other
cells. In those cells I what to make a msgbox warns the user that the value
of one of them or all is under 0 and the user should input other data . i.e.
if E1 has the value of sum A1and B1, a msg box appears and warns.
how can I do that?


Hi

Insert the code in the code-sheet for the desired sheet.

Private Sub Worksheet_Calculate()
If Range("E1") < 0 Then
MsgBox ("Error")
End If
End Sub

//Per
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default How to create msg box if a cell contains value < 0

The problem I see with a message box solution is as soon as the message box
was dismissed, it would pop up again giving the user no time to act. How
about this instead. Select the five cells; click
Format/ConditionalFormatting from Excel's menu; select "Cell Value Is" from
the first field, "less than" from the second field, put 0 into the third
field; click the Format button; click the Font tab and select Bold from the
"Font style" field and White from the Color drop down; click the Patterns
tab and pick a dark red color from the Color grid; then OK your way back to
the spread sheet. Now, if any of these cells fall below zero, they will be
highlighted in the color with the font style you just picked.

Rick


"ghost" wrote in message
...
Greeting,
I have a column has 5 cells which they have function (sum) depend on other
cells. In those cells I what to make a msgbox warns the user that the
value
of one of them or all is under 0 and the user should input other data .
i.e.
if E1 has the value of sum A1and B1, a msg box appears and warns.
how can I do that?


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
Using a cell reference to create linked info in another cell LCrowe Excel Discussion (Misc queries) 2 February 28th 08 05:26 PM
Create Cell Comment based on text in a cell on another worksheet Dave Fellman Excel Discussion (Misc queries) 2 March 15th 07 09:49 AM
How to create table of cell names with the name's cell address WildwoodEngr Excel Discussion (Misc queries) 1 October 26th 06 02:52 PM
How to create/run "cell A equals Cell B put Cell C info in Cell D abmb161 Excel Discussion (Misc queries) 5 January 26th 06 06:36 PM
Excel - create button to replace cell content with cell value blackmot Excel Worksheet Functions 3 December 7th 05 05:10 PM


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