|
ありがとうございました。
Z以降ができないみたいなので、自分で関数を作りました。
無駄なものだとは思いますが、一応公開しておきます。
↓↓↓↓↓↓↓↓
Public Function R1C1Num_Convert(Num As Integer)
'Num:列番号
Dim Cnt As Integer
Dim StrTxt1, StrTxt2 As String
Dim Quotient As Double '商(実数)
Dim QuotientInt As Integer '商(整数)
Dim Remainder As Integer '余り
Const Alphabet As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Const AlphabetLen As Integer = 26
If Num < 1 And 256 < Num Then
Exit Function
End If
Quotient = Num / AlphabetLen
If Quotient - Int(Quotient) > 0 Then
QuotientInt = Int(Quotient)
Else
QuotientInt = Int(Quotient) - 1
End If
Remainder = Num Mod AlphabetLen
If Remainder = 0 Then
Remainder = AlphabetLen
End If
If QuotientInt = 0 Then
StrTxt1 = ""
Else
StrTxt1 = Mid(Alphabet, QuotientInt, 1)
End If
StrTxt2 = Mid(Alphabet, Remainder, 1)
R1C1Num_Convert = Trim(StrTxt1) & Trim(StrTxt2)
End Function
|
|