Ascii udf assistance

simico

New Member
Joined
May 27, 2011
Messages
30
Hello Mr Excel people of the world,

I am in need of some assistance. I have a formula which takes a cell, converts each character to ascii, subtracts 133, and then converts it back to a character. I need the same thing, but in a UDF. I'm sure there is a simpler way in VBA than what I am doing via formula. It's just a simple cypher I am doing in another program that I want to be able to de-cypher in Excel.

Here is the formula, with B2 being the cell with the sample data below:
Code:
=CHAR(CODE(B2)-133)&CHAR(CODE(MID(B2, 2, 1)) -133)&CHAR(CODE(MID(B2, 3, 1)) -133)&CHAR(CODE(MID(B2, 4, 1)) -133)&CHAR(CODE(MID(B2, 5, 1)) -133)&CHAR(CODE(MID(B2, 6, 1)) -133)&CHAR(CODE(MID(B2, 7, 1)) -133)&CHAR(CODE(MID(B2, 8, 1)) -133)

Sample data:
ƾ¾ÍÙ¾¾·

Sample results:
A99HT992

Any help would be greatly appreciated!



Excel 2007
Windows 7
 
Try this

Function shifter(inputcode)
Dim codeA$(8)

For i = 1 To 8
codeA$(i) = Chr(Asc(Mid(inputcode, i, 1)) - 133)
shifter = shifter + codeA$(i)

Next i
End Function
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top