filmov
tv
Change Case in Excel without Formula | How to change Lowercase to Uppercase in Excel
Показать описание
How to enable Change case (Lowercase, Uppercase, Proper case letters) in MS-Excel 2007, 2010, 2013 & 2016 Without Formula using Macro code (VBA-Visual Basic Editor)
--------------------------Macro Code-----------------------
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
-----------------Related Videos----------------------
--------------------------My Stuff-----------------------
--------------------------Follow us-----------------------
Keep Watching, Keep learning...!!!
-~-~~-~~~-~~-~-
Please watch: "How to Use Macro in Excel | How to Create Macros in Excel | Macro Record kaise kare | Macro in Excel"
-~-~~-~~~-~~-~-
--------------------------Macro Code-----------------------
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
-----------------Related Videos----------------------
--------------------------My Stuff-----------------------
--------------------------Follow us-----------------------
Keep Watching, Keep learning...!!!
-~-~~-~~~-~~-~-
Please watch: "How to Use Macro in Excel | How to Create Macros in Excel | Macro Record kaise kare | Macro in Excel"
-~-~~-~~~-~~-~-
Комментарии