Here's another one I've been struggling with this afternoon.
I have this code to convert all text in a named range (SubLotColumn) to uppercase:
This works fine except that there are instances when I don't want the text uppercase. I want all instances of the letter M to be uppercase when it is followed by a dash such as this:
1124M-50
However, if the text appears without a dash following such as this:
Christmas Eve
...I do not want it uppercase.
It will always be an M.
I have this code to convert all text in a named range (SubLotColumn) to uppercase:
VBA Code:
If Not Intersect(Target, Range("SubLotColumn")) Is Nothing Then
Application.EnableEvents = False
If Trim(Target) <> "" Then
Target = UCase(Target)
End If
Application.EnableEvents = True
End If
This works fine except that there are instances when I don't want the text uppercase. I want all instances of the letter M to be uppercase when it is followed by a dash such as this:
1124M-50
However, if the text appears without a dash following such as this:
Christmas Eve
...I do not want it uppercase.
It will always be an M.