LoginSignup
4
3

More than 5 years have passed since last update.

数値をエクセルの列表現に変換する関数

Last updated at Posted at 2014-05-17

もっと他に方法が用意されているのではないかと思いますが、
見つけられ無かったので自作しました。

Function alpha(ByVal i As Long) As String
'    与えられた数値をエクセルの列を表すアルファベットにして返す。
    Dim ret As String
    ret = ""
    Do
        i = i - 1
        ret = Chr(i Mod 26 + 65) & ret
        i = i \ 26
    Loop While i > 0

    alpha = ret
End Function
4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3