hmltnangel
Active Member
- Joined
- Aug 25, 2010
- Messages
- 290
- Office Version
- 365
- Platform
- Windows
Hi all,
I have tried many little bits and pieces to try and make this work, but im guessing im just not getting the syntax right. So if anyone can point me to the answer, and how I went wrong - itd be appreciated.
I have a nice piece of code that someone on here helped with - this works great, so I dont want to mess it too much.
Effectively after the first step, I want to add a small piece that changes the contents of AB to 0, if AC is not blank, and also changes the value of AB to 0.5 if D equals "Red" AND the value input in AB is less than 0.5.
The code is below so far and where I would like to add that piece is marked
I have tried many little bits and pieces to try and make this work, but im guessing im just not getting the syntax right. So if anyone can point me to the answer, and how I went wrong - itd be appreciated.
I have a nice piece of code that someone on here helped with - this works great, so I dont want to mess it too much.
Effectively after the first step, I want to add a small piece that changes the contents of AB to 0, if AC is not blank, and also changes the value of AB to 0.5 if D equals "Red" AND the value input in AB is less than 0.5.
The code is below so far and where I would like to add that piece is marked
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
Dim msg As String
' Colour Checker - MsgBox Target.DisplayFormat.Interior.Color -
If Intersect(Target, Range("AC4:AC2000")) Is Nothing Then Exit Sub
If cells(Target.Row, 30).Value <> "" Then
msg = msg & vbCrLf & vbCrLf & "Ineligible for Merit Award: " & cells(Target.Row, 30).Value
End If
If msg <> "" Then MsgBox msg, Title:="Ineligible Colleague"
'POP THIS NEW BIT OF CODE IN HERE
If Target.Value > 0 Then
If Target.DisplayFormat.Interior.Color = 8696052 Then
msg = "High Comp Ratio: Individuals Comp Ratio is in excess of 120%. Recommendation is that Merit Award does not exceed 1%"
End If
End If
If Target.Value > 0 Then
If Target.DisplayFormat.Interior.Color = 13551615 Then
msg = vbCrLf & vbCrLf & "Low Comp Ratio: Individuals Comp Ratio is below 80%. Consideration should be given to providing a higher increase for this individual"
End If
End If
' Check value in column 22
If cells(Target.Row, 22).Value = "0 - Too new to rate" Then
msg = msg & vbCrLf & vbCrLf & "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."
End If
' See if any message to return
If msg <> "" Then MsgBox msg, Title:="Potential Issues to Address"
End Sub