小编Mr *_*agi的帖子

将数字字符转换为字母字符

我试图获得如下I/O:

输入:123490
输出:BCDEJA

逻辑很简单:

如果
strarr(i)=0,1,2,3,4,5,6,7,8,9
那么
strarr(i) should be = A,B,C,D,E,F,G,H,I,J

str = .Cells(18, "B").Value
strarr() = Split(str) 
For i = LBound(strarr) To UBound(strarr)
  If strarr(i) = 0 Then
  .Cells(24, "B") = "A" & .Cells(24, "B")
  Else
  If strarr(i) = 1 Then
  .Cells(24, "C") = "B" & .Cells(24, "C")
  Else
  If strarr(i) = 2 Then
  .Cells(24, "C") = "C" & .Cells(24, "C")
  Else
  If strarr(i) = 3 Then
  .Cells(24, "D") = "D" & .Cells(24, "D")
  Else
  .
  . …
Run Code Online (Sandbox Code Playgroud)

excel vba function excel-vba

7
推荐指数
1
解决办法
219
查看次数

标签 统计

excel ×1

excel-vba ×1

function ×1

vba ×1