To je dobro, če želite namesto celic (1,1) uporabiti stavke, kot je Razpon ("A1").
Tako na primer ColLetter (1) = A, ColLetter (2) = b,…, ColLetter (100) = CV itd.
3) ColLetter (številka stolpca) => poda nazaj črko stolpca.
ColLetter javne funkcije (colNumber As Long) As String
Če je colNumber <27 Potem
Če je colNumber = 0, potem
ColLetter = "Z"
Sicer pa
ColLetter = Mid ("ABCDEFGHIJKLMNOPQRSTUVWXYZ", colNumber, 1)
Konec Če
Sicer pa
Če je colNumber <26 2 + 27 Potem
ColLetter = Mid ("ABCDEFGHIJKLMNOPQRSTUVWXYZ", FLOOR (colNumber / 26), 1)
ColLetter = ColLetter & ColLetter (colNumber Mod 26)
Sicer pa
ColLetter = Mid ("ABCDEFGHIJKLMNOPQRSTUVWXYZ", FLOOR ((št. Stolpca - 26) / 676), 1)
ColLetter = ColLetter & ColLetter (colNumber - FLOOR ((colNumber - 26) / 676) * 676)
Konec Če
Konec Če
Končana funkcija