LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
SG SG is offline
external usenet poster
 
Posts: 2
Default Message box if cell is greater than less than 0

I had some pretty good help on this problem and thought we had it nailed,
but a slight problem still remains.

I need a message box to appear when two amounts do not match and I need this
to happen as the amounts are typed in.

To make this short lets say Column A-Cell 1 through Cell 1000 has a negative
number ($50.00) and this will always be the case. Column B-Cell 1 through
Cell1000 will have a matching number with the exception it will be a
positive number. Column C-Cell 1 has the following formula =SUM(A1:B1) and
all Cells below that =SUM(B1:C1) and so on.

The following code whom someone wrote for me works with the exception as
soon as you type in the first number the message box appears.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Application.EnableEvents = False
Set myRng = Range("C2:X1000") ' Change if necessary
If Application.WorksheetFunction.Sum(myRng) < 0 Then
MsgBox "Totals are out of Balance"
End If
Set myRng = Nothing
Application.EnableEvents = True
End Sub

Is there a way to make this code pause until both numbers are entered before
it checks it?

Conditional formatting was suggested and turns the Cell a color, but this is
no good for what I need. I really need a message box as I input the Data.
This sheet is quite large and the Cells and Columns run out of site. It was
suggested to do a Window-Freeze, freezing the First 4 or 5 rows, but this
won't work for me. It still causes me to go back and read Check numbers, the
amount entered in the negative number and scroll over to the positive number
and make the correction whichever it may be. I use the Data Form to cut down
on scrolling, but at the end of the day I have to check my last row formulas
to see if all Data was entered correctly and if not it's taking to much time
to correct all my mistakes.

All the best,
SG


 
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
Create error message if number entered is greater than previous ce Joe Lewis Excel Discussion (Misc queries) 2 July 25th 08 01:59 AM
Message box if cell is greater than less than 0 [Zero] SG Excel Discussion (Misc queries) 9 May 18th 06 10:42 PM
Intercept/replace standard 'cell protected' message with my own message? KR Excel Programming 3 March 16th 06 02:31 PM
Addition to Turn cell red if today is greater or equal to date in cell Rich New Users to Excel 2 December 9th 04 02:06 AM
Turn cell red if today is greater or equal to date in cell Rich New Users to Excel 2 December 7th 04 10:50 PM


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