VBA - Combine Multiple Message Box into a single box

hmltnangel

Active Member
Joined
Aug 25, 2010
Messages
290
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Hope you can figure out the last little bit (hopefully) that can combine these queries into one message box. Instead of three boxes, one after the other.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range) 'WS change is whenever a value in target cell is changed
Dim cell As Range

If Target.Value > 0 Then
            If Target.DisplayFormat.Interior.Color = 8696052 Then
            MsgBox "DH Warning: Individuals Comp Ratio is in excess of 120%. Recommendation is that Merit Award does not exceed 1%", Title:=("Comp Ratio High")
            End If
End If

    If Intersect(Target, Range("AB4:AB2000")) Is Nothing Then Exit Sub

'   Check value in column 22
    If Cells(Target.Row, 22).Value = "0 - Too new to rate" Then
        MsgBox "Too New To Rate: This employee has not had a formal Performance Appraisal for FY23. Please ensure that the performance is still factored into your merit decision.", Title:=("Performance Rating")
    End If

For Each cell In Range("AC4:AC2000")
If cell.Value = "Individual Budget Exceeded" Then
    MsgBox "You have exceeded the Individual Budget for this person. Please ensure this is correct before confirming", Title:=("Individual Budget Exceeded")
End If
Next cell

End Sub
 
I am indeed, I changed it a tiny bit to suit the amended requirements. But your solution was perfect. No idea why Excel needed restarted but it works as expected now.
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Excellent.
Glad to hear it!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top