Convert integer to Excel column

Hello @mzucker

use this code
Convert.ToChar(Convert.ToUInt16("@"c)+4)

you can also start with A but then to get D you’ll have to add 3
Convert.ToChar(Convert.ToUInt16("A"c)+3)

Use what suits you the best !!!

As @DanielMitchell said below the above could work for 26 letters.You could always get two letter by using an IF condition and assigning the above code twice with a + sign like this

Convert.ToChar(Convert.ToUInt16("A"c)+3)+Convert.ToChar(Convert.ToUInt16("A"c)+3)

So If the digits are higher then I would suggest you to use @DanielMitchell link i tried the logic and methods used in that link and it works flawlessly. :slight_smile:

Check the workflow below it contains logic used in that link
ColumnLetterFor.xaml (7.3 KB)

5 Likes