How to returns alphabet from excel column number?

I have VBA code, but I can’t use it on the Invoke Code activities!
Is there any way to convert to vb.net code or use other methods to achieve it?
VBA code:

Function ColumnNumberToLetter(iCol As Long) As String
Dim lAlpha As Long
Dim lRemainder As Long
If iCol <= 26 Then
ColumnNumberToLetter = Chr(iCol + 64)
Else
lRemainder = iCol Mod 26
lAlpha = Int(iCol / 26)
If lRemainder = 0 Then
lRemainder = 26
lAlpha = lAlpha - 1
End If
ColumnNumberToLetter = ColumnNumberToLetter(lAlpha) & Chr(lRemainder + 64)
End If
End Function

Remove the function and declare dim icol as long and paste the code inside invoke code activity

Thanks
Ashwin .S

ThankQ!
I get it!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.