How to change Lowercase to Uppercase in Excel without Formula

Sub ChangeTextCase()
Dim strChange As String
strChange = InputBox("Type l, u, or p to change case:" & vbCr & vbLf & vbCr & vbLf & _
"Lowercase = l, uppercase = u, proper case = p", "Change case of selected cells", "")
Select Case strChange
Case "l", "L"
For Each x In Application.Selection
x.Value = LCase(x.Value)
Next
Case "u", "U"
For Each x In Application.Selection
x.Value = UCase(x.Value)
Next
Case "p", "P"
For Each x In Application.Selection
x.Value = WorksheetFunction.Proper(x.Value)
Next
Case Else
MsgBox "Type l, u, or p." & vbCr & vbLf & vbCr & vbLf & "Click OK to start over."
End Select
End Sub

Leave a Comment