![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.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://images.cnblogs.com/OutliningIndicators/ContractedBlock.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