Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Message box help

I would like to have a message box appear when the value of a cell is
greater than what I have determined, then place a statement in a cell
to show a message. For example; if the value of a cell is greater that
$600.00, then the message box would pop up and state "Supervisor
Approval Needed". Then it would place a line on the sheet that states
"Supervisor contacted" in the cell of my choosing.

Thanks,

Michael

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Message box help

Michael, try this,

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Application.EnableEvents = False
If Target.Address = "$A$1" And Target.Value 600 Then
MsgBox "Supervisor Approval Needed"
[A2] = "Supervisor contacted"
End If
Application.EnableEvents = True
End Sub

this is worksheet code, right click on the sheet tab, view code to put it in

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"hedgehog1" wrote in message
ps.com...
I would like to have a message box appear when the value of a cell is
greater than what I have determined, then place a statement in a cell
to show a message. For example; if the value of a cell is greater that
$600.00, then the message box would pop up and state "Supervisor
Approval Needed". Then it would place a line on the sheet that states
"Supervisor contacted" in the cell of my choosing.

Thanks,

Michael



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Message box help

Hi Michael,

Try:

'=============
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim rngNote As Range
Const msg As String = "Supervisor Approval Needed"
Const sstr As String = "Supervisor contacted"

Const triggerVal As Double = 600 '<<==== CHANGE

Set rng = Me.Range("A1:A20") '<<==== CHANGE
Set rngNote = Me.Range("B1") '<<==== CHANGE

If Not Intersect(rng, Target) Is Nothing Then
If Target.Value triggerVal Then
MsgBox Prompt:=msg, _
Buttons:=vbCritical, _
Title:="Threshold Exceeded!"
Application.EnableEvents = False
rngNote.Value = sstr
Application.EnableEvents = True
End If
End If
End Sub
'<<=============

This is worksheet event code and should be pasted into the worksheets's code
module (not a standard module and not the workbook's ThisWorkbook module):

Right-click the worksheet's tab
Select 'View Code' from the menu and paste the code.
Alt-F11 to return to Excel.


---
Regards,
Norman


"hedgehog1" wrote in message
ps.com...
I would like to have a message box appear when the value of a cell is
greater than what I have determined, then place a statement in a cell
to show a message. For example; if the value of a cell is greater that
$600.00, then the message box would pop up and state "Supervisor
Approval Needed". Then it would place a line on the sheet that states
"Supervisor contacted" in the cell of my choosing.

Thanks,

Michael



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
replace VBA run-time error message with custom message BEEJAY Excel Programming 13 July 14th 06 03:59 PM
Replace Excel Message w/Custom Message Kevin R Excel Programming 1 May 18th 06 04:13 PM
Intercept/replace standard 'cell protected' message with my own message? KR Excel Programming 3 March 16th 06 02:31 PM
Opening an attachment of a message that has a message as attachmen vetron Excel Programming 0 January 30th 06 06:17 PM
Displaying a message in a message box without requiring user to click anything to proceed Android[_2_] Excel Programming 2 June 25th 04 06:44 PM


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