+ -
当前位置:首页 → 问答吧 → 使用工作表函数进行大小写转换

使用工作表函数进行大小写转换

时间:2011-08-07

来源:互联网

Sub 首字母大写()
   Dim a As Range
   Dim b As String
   On Error Resume Next
   a = Selection
   b = application.WorksheetFunction proper("a")
   Selection = b
   
End Sub
系统提示编译错误。找不出原因。

作者: parato   发布时间: 2011-08-07

Dim a As String
   Dim b As String
   On Error Resume Next
   a = Selection
   b = Application.WorksheetFunction.Proper(a)
   Selection = b

用ActiveCell代替Selection
   Dim a As String
   Dim b As String
   On Error Resume Next
   a = ActiveCell
   b = Application.WorksheetFunction.Proper(a)
   ActiveCell = b

[ 本帖最后由 zhaogang1960 于 2011-8-7 15:41 编辑 ]

作者: zhaogang1960   发布时间: 2011-08-07

相关阅读 更多