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