Excel中如何将带有小数点的数字替换成对应的字母
发布网友
发布时间:2022-03-09 02:07
我来回答
共1个回答
热心网友
时间:2022-03-09 03:36
1、定义如下宏
Sub MyReplace()
Dim str() As Variant
Dim i As Integer
Dim s As String
s = [A1]
' 请把数组的元素的值改成你需要的值
str = Array("零", "E", "二", "S", "四", "W", "六", "七", "八", "九")
s = Replace(s, ".", "R")
For i = LBound(str) To UBound(str)
s = Replace(s, CStr(i), str(i))
Next i
[A2] = s
End Sub
2、在A1中输入小数,执行以上宏,替换后的值显示在A2追问谢谢,可以替换了,请问一列数字(A1 A2 A3.........) 怎么运行这个宏呢?