c# 字母替换为数字
VBA代码,用字母(Excel列)替换任何数值。
Function Convert_Number_to_Aplha(ByVal num As Long) As String
Dim buf As String
buf = Cells(1, num).Address(True, False)
Convert_Number_to_Aplha = Left(buf, InStr(buf, "$") - 1)
End Function
例
Sub sample1()
Dim S As String
Dim i As Integer
For i = 1 To 40
S = Convert_Number_to_Aplha(i)
Cells(1, i).Value = S
Next i
End Sub
翻译自: https://bytes.com/topic/excel/insights/973771-how-replace-number-alphabet
c# 字母替换为数字