» Display message if column total is exceeded using VBA in Microsoft Excel
CATEGORY - General Topics in VBA
VERSION - All Microsoft Excel Versions
If total of values in entry area cell 9 to cell 22 exceeds 7.5, a message is to be displayed
Answer:
Insert the following code in the appropriate modules.
Place the code below into the standard module
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 4 Or Target.Column > 34 Then Exit Sub
If Target.Row < 9 Or Target.Row > 22 Then Exit Sub
If WorksheetFunction.Sum(Range(Cells(9, Target.Column), _
Cells(22, Target.Column))) > 7.5 Then
Beep
MsgBox "Caution, the value of 7.5 is exceeded!"
End If
End Sub
Book Store:
Recommended Books:
- Windows XP Annoyances
- Rich Dad's Guide to Investing: What the Rich Invest in, That the Poor and the Middle Class Do Not!
- Now, Discover Your Strengths
- Microsoft Word Version 2002 Step By Step (With CD-ROM)
- Your First Business Plan: A Simple Question and Answer Format Designed to Help You Write Your Own Plan (3rd Ed)
- Financial Peace: Revisited
No comments have been submitted.

