Revision 323537323931 () - Diff

Link to this snippet: https://friendpaste.com/4AnRk0kR6gEaWlXn6f7GcH
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Function convert(i As Long) As String
Dim num As Long
Dim str As String
str = Chr(((i - 1) Mod 26) + 65)
num = (i - 1) \ 26
Do While num <> 0
str = Chr(((num - 1) Mod 26) + 65) & str
num = (num - 1) \ 26
Loop
convert = str
End Function


Sub Macro1()
Dim i As Long
For i = 1 To 5000
Cells(i, 1) = i
Cells(i, 2) = convert(i)
Next
End Sub