VBA LCASE 函数将字符串转换为小写。
LCase(文本)
使用 LCase 函数将字符串转换为小写:
Sub LCaseExample1()
text = "Example@MOONEXCEL.com.ua"
text = LCase(text)
MsgBox text '返回:example@moonexcel.com.ua
End Sub
使用 LCase 函数检查字符串是否为小写:
Sub LCaseExample2()
nickname = "Treecher_21"
'我们检查昵称(nickname)是否等于其转换为小写的值
If nickname = LCase(nickname) Then
MsgBox "是的,所有别名字符都是小写的。"
Else
MsgBox "不,昵称包含大写字母。" '将显示此结果
End If
End Sub