excel vba force uppercase code example
Example 1: excel vba convert and entire range to uppercase
[a1:c99] = [index(upper(a1:c99),)]
Sub ToUpper(r As Range)
r = Evaluate("index(upper(" & r.Address & "),)")
End Sub
[a1:c99] = [index(lower(a1:c99),)]
Sub ToLower(r As Range)
r = Evaluate("index(lower(" & r.Address & "),)")
End Sub
Example 2: excel vba to upper case
Dim sText As String
sText = "Run, forrest run"
MsgBox StrConv(sText, vbProperCase)
MsgBox StrConv(sText, vbLowerCase)
MsgBox StrConv(sText, vbUpperCase)
MsgBox UCase(sText)