![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
Public Function GetColName(ByVal strAddress As String, ByVal Start As Integer) As String
' Dim strAddress As String
Dim endP As Integer
' strAddress = ActiveCell.Address
' endP = InStr(2, strAddress, "$")
endP = InStr(Start, strAddress, "$")
GetColName = SubString(strAddress, 2, endP - 1)
Debug.Print GetColName
End Function
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
Public Function SubString(ByVal str As String, ByVal Startp As Integer, ByVal endP As Integer) As String
SubString = Mid(str, Startp, endP - Startp + 1)
End Function