码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2020-06-05 11:38:33      阅读:93      评论:0      收藏:0      [点我收藏+]

标签:count   常用   str   func   public   定义   replace   cells   字母   


‘列数转字母
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

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

标签:count   常用   str   func   public   定义   replace   cells   字母   

原文地址:https://www.cnblogs.com/hewish/p/13048727.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!