Trevor3007
Well-known Member
- Joined
- Jan 26, 2017
- Messages
- 667
- Office Version
- 365
- Platform
- Windows
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
''''''''''''''''''''''''''''''''''''''''''''
'Forces text to UPPER case for a range XYX
'Forces text to Proper case for a range TUV
''''''''''''''''''''''''''''''''''''''''''''
If Target.Cells.Count > 1 Or Target.HasFormula Then Exit Sub
On Error Resume Next
If Not Intersect(Target, Range("a1:a100")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
On Error GoTo 0
If Target.Cells.Count > 1 Or Target.HasFormula Then Exit Sub
On Error Resume Next
If Not Intersect(Target, Range("B1:B100")) Is Nothing Then
Application.EnableEvents = False
Target = StrConv(Target, vbProperCase)
Application.EnableEvents = True
End If
On Error GoTo 0
End Sub
I need to include 'lcase'(lowercase) into the range E2:F100.
Having thought all I needed to do was alter ; Target = StrConv(Target, vbProperCase)' to Target = StrConv(Target, lcase) would of worked, but it does not.
Searching the web , never gave me the exact solution , so therefore I am reaching out to Mr Excel for help.
many thanks in advance & thank you for your help.