I had this VB code that worked great when I entered values as 1, 2, 3 etc.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
Select Case Target.Formula
Case 1: Target.Value = Target.Value & "st"
Case 2: Target.Value = Target.Value & "nd"
Case 3: Target.Value = Target.Value & "rd"
Case 4 To 16: Target.Value = Target.Value & "th"
End Select
Application.EnableEvents = True
End Sub
However, I am now slightly changing the functionality of that column so that the values are automatically entered based on the value in the adjacent column using a RANK formula.
I have this formula
=IF(ISBLANK(E2),"",RANK(E2,$E$2:$E$17,1))
Unfortunately, the values are no longer converted to 1st, 2nd, 3rd etc. Is there any way to do this? - make the formula and VB work together?
Thanks
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
Select Case Target.Formula
Case 1: Target.Value = Target.Value & "st"
Case 2: Target.Value = Target.Value & "nd"
Case 3: Target.Value = Target.Value & "rd"
Case 4 To 16: Target.Value = Target.Value & "th"
End Select
Application.EnableEvents = True
End Sub
However, I am now slightly changing the functionality of that column so that the values are automatically entered based on the value in the adjacent column using a RANK formula.
I have this formula
=IF(ISBLANK(E2),"",RANK(E2,$E$2:$E$17,1))
Unfortunately, the values are no longer converted to 1st, 2nd, 3rd etc. Is there any way to do this? - make the formula and VB work together?
Thanks