TOP

函数VBA:LCase

描述

VBA LCASE 函数将字符串转换为小写。


LCASE语法

LCase(文本)

示例 VBA 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
将文本转换为大写的反向函数是函数 UCASE

LO Calc 中的 YLC 实用程序菜单

LO Calc 中的 YLC 实用程序菜单

Excel 中的 YLC 实用程序菜单

Excel 中的 YLC 实用程序菜单