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


Im new to excel and have just been finding out the basics of macros. Ca
anyone tell me how to make a message box appear when a certain cell
value reaches 0

--
Scarecro
-----------------------------------------------------------------------
Scarecrow's Profile: http://www.excelforum.com/member.php...fo&userid=3536
View this thread: http://www.excelforum.com/showthread.php?threadid=55133

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Message Box Help

Try this it tests A6
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("A6").Value = 0 Then MsgBox ("Value = 0")

End Sub
--
David


"Scarecrow" wrote:


Im new to excel and have just been finding out the basics of macros. Can
anyone tell me how to make a message box appear when a certain cells
value reaches 0?


--
Scarecrow
------------------------------------------------------------------------
Scarecrow's Profile: http://www.excelforum.com/member.php...o&userid=35364
View this thread: http://www.excelforum.com/showthread...hreadid=551335


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

Hi Scarecrow,

Try:

'=============
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng1 As Range, rng2 As Range

Set rng1 = Me.Range("A1") '<<==== CHANGE

On Error Resume Next
Set rng2 = Intersect(Target, rng1.Precedents)
On Error GoTo 0

If Not Intersect(rng1, Target) Is Nothing _
Or Not rng2 Is Nothing Then
With rng1
If Not .Value = "" And .Value = 0 Then
MsgBox rng1.Address(0, 0) & " value = 0"
End If
End With
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



"Scarecrow" wrote
in message ...

Im new to excel and have just been finding out the basics of macros. Can
anyone tell me how to make a message box appear when a certain cells
value reaches 0?


--
Scarecrow
------------------------------------------------------------------------
Scarecrow's Profile:
http://www.excelforum.com/member.php...o&userid=35364
View this thread: http://www.excelforum.com/showthread...hreadid=551335



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 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
changing the message in an error message The Villages DA Excel Worksheet Functions 2 February 18th 05 05:30 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 05:01 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"