Private Function pstr列アルファベットFrom列番号(ByVal plng列番号 As Long) As String
Dim str1 As String
Dim int1 As Integer
Dim str2 As String
Dim int2 As Integer
Dim str3 As String
Dim int3 As Integer
int3 = plng列番号 Mod 26
str3 = pstr列アルファベットFrom列番号_Sub(int3)
If plng列番号 > 26 Then
int2 = Int((plng列番号 - 1) / 26) Mod 26
str2 = pstr列アルファベットFrom列番号_Sub(int2)
Else
str2 = ""
End If
If plng列番号 >= 703 Then
int1 = Int((plng列番号 - 1) / (26 * 26)) Mod 26
str1 = pstr列アルファベットFrom列番号_Sub(int1)
Else
str1 = ""
End If
pstr列アルファベットFrom列番号 = str1 & str2 & str3
End Function
Private Function pstr列アルファベットFrom列番号_Sub(ByVal pint As Long) As String
If pint = 0 Then
pstr列アルファベットFrom列番号_Sub = "Z"
Else
pstr列アルファベットFrom列番号_Sub = Chr(64 + pint)
End If
End Function