Access Excel列番号 列名 変換

'列番号を文字に変換するユーザー定義関数

Function ColNum2Txt(lngColNum As Long) As String

    On Error GoTo ErrHandler

    

    Dim strAddr As String

    

    strAddr = Cells(1, lngColNum).Address(False, False)

    ColNum2Txt = Left(strAddr, Len(strAddr) - 1)

    

    Exit Function

 

ErrHandler:

    

    ColNum2Txt = ""

 

End Function