'将数值转换为表示A -Z的类似EXCEL的字母串
Function NumToAlphabet(Number As Integer) As String
Dim dblNum As Long
Dim digit As Long
Const conStrList As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
dblNum = Number
Do Until dblNum = 0
digit = dblNum Mod 26
If digit = 0 Then digit = 26
NumToAlphabet = NumToAlphabet & Mid(conStrList, digit, 1)
Debug.Print NumToAlphabet, digit
If digit = 26 Then
dblNum = (dblNum \ 26) - 1
Else
dblNum = dblNum \ 26
End If
Debug.Print dblNum
Loop
NumToAlphabet = StrReverse(NumToAlphabet)
End Function
Access软件网交流QQ群(群号:198465573) |