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

When a recalc is performed, if there is an out-of-balance situation, I want
spreadsheet to alert the user with a msgbox("There is an Out-of-Balance").
How can I do that without having the user do anything besides just recalc the
spreadsheet? The recalc could even be an automatic recalc.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Recalc Alarm

There is a calculate event that you can capture. In the sheet that you wnat
to check the balance on add this code (right click the tab and select view
code). You will want to change the range addresses.

Private Sub Worksheet_Calculate()
If Range("A1").Value < Range("B1").Value Then _
MsgBox "You are out of balance", vbInformation, "Out of Balance"
End Sub
--
HTH...

Jim Thomlinson


"Mike H." wrote:

When a recalc is performed, if there is an out-of-balance situation, I want
spreadsheet to alert the user with a msgbox("There is an Out-of-Balance").
How can I do that without having the user do anything besides just recalc the
spreadsheet? The recalc could even be an automatic recalc.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default Recalc Alarm

That works great. How would I refer to a named range like this:
if reference.namedRange<0 then _
MsgBox "You are out of balance", vbInformation, "Out of Balance"


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default Recalc Alarm

Found it myself:
Set rng = Range("Gana39GrandTotal")
If Abs(Round(rng, 2)) 0.01 Then
MsgBox "You are out of balance", vbInformation, "Out of Balance"

I am using the abs of the round of the number to be greater than .01 because
the data is imported and won't exactly equal Zero. This should do it.
Thanks a lot.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Recalc Alarm

One way:

If Range("name").Value < 0 Then _


In article ,
Mike H. wrote:

That works great. How would I refer to a named range like this:
if reference.namedRange<0 then _
MsgBox "You are out of balance", vbInformation, "Out of Balance"



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
Alarm Tomas Excel Worksheet Functions 3 November 24th 09 12:15 AM
FLASH ALARM osama amer Excel Discussion (Misc queries) 0 August 28th 06 10:30 AM
Alarm Manthony Excel Programming 0 June 6th 06 03:46 PM
Schedule Alarm Richard Excel Discussion (Misc queries) 0 October 14th 05 01:54 PM
Timer Alarm jimbo Excel Programming 6 March 28th 05 08:02 PM


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