Convert numeric characters to alphabetic characters

前端 未结 5 1381
日久生厌
日久生厌 2021-01-02 16:12

I am trying to get I/O as follows:

Input : 123490
Output : BCDEJA

Logic is simple:

if
strarr(i)=0,1,2

5条回答
  •  醉酒成梦
    2021-01-02 16:47

    As Jeeped said you can use the Chr function to convert a number to a letter, using ASCII.

    on another note, when working with a single variable which can have multiple values, instead of using so much if's I would suggest using a case select model, use strarr(i) as the controller it would simplify your code and would be a lot more readable.

    Also, instead of writing the different values to cells, I would have used a temporary variable to store the aggregated value, less hassle for you and a bit faster as you don't read/write to the sheet instead you're just working in the background

提交回复
热议问题