VBA常用自定义函数(1) - 列数转列名&列名转列数


'列数转字母
Public Function CNtoW(ByVal number As Long) As String
    CNtoW = Replace(Cells(1, number).Address(False, False), "1", "")
End Function


'字母转列数
Public Function CWtoN(ByVal letters As String) As Long
    CWtoN = Range("a1:" & letters & "1").Cells.Count
End Function

posted @ 2020-06-05 11:31  何未生  阅读(567)  评论(0编辑  收藏  举报