VBA获取EXCEL列名

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

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