Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
roto13
Hello
Is their a macro around that well do roto13 code? thanks Basil |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
roto13
There is a nice one here
http://www.erlandsendata.no/english/...ndownloadtools The data form is in Norwigian so you will needed to get a few words translated. The macro is in English best wishes -- Bernard V Liengme Microsoft Excel MVP www.stfx.ca/people/bliengme remove caps from email "basil" wrote in message ... Hello Is their a macro around that well do roto13 code? thanks Basil |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
roto13
PS: if you Google for this use ROT13 not ROTO13
best wishes -- Bernard V Liengme Microsoft Excel MVP www.stfx.ca/people/bliengme remove caps from email "basil" wrote in message ... Hello Is their a macro around that well do roto13 code? thanks Basil |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
roto13
It's pretty simple
Public Function encrypt(pInput As String) Dim n As Integer Dim i As Integer n = 13 For i = 1 To Len(pInput) Mid(pInput, i, 1) = Chr(Asc(Mid(pInput, i, 1)) + n) Next i encrypt = pInput End Function Public Function decrypt(pInput As String) Dim n As Integer Dim i As Integer n = 13 For i = 1 To Len(pInput) Mid(pInput, i, 1) = Chr(Asc(Mid(pInput, i, 1)) - n) Next i decrypt = pInput End Function -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "basil" wrote in message ... Hello Is their a macro around that well do roto13 code? thanks Basil |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
roto13
Thanks Bernard
I'll check this out. "Bernard Liengme" wrote in message ... PS: if you Google for this use ROT13 not ROTO13 best wishes -- Bernard V Liengme Microsoft Excel MVP www.stfx.ca/people/bliengme remove caps from email "basil" wrote in message ... Hello Is their a macro around that well do roto13 code? thanks Basil |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
roto13
Thank you Bob
I will try this also Basil "Bob Phillips" wrote in message ... It's pretty simple Public Function encrypt(pInput As String) Dim n As Integer Dim i As Integer n = 13 For i = 1 To Len(pInput) Mid(pInput, i, 1) = Chr(Asc(Mid(pInput, i, 1)) + n) Next i encrypt = pInput End Function Public Function decrypt(pInput As String) Dim n As Integer Dim i As Integer n = 13 For i = 1 To Len(pInput) Mid(pInput, i, 1) = Chr(Asc(Mid(pInput, i, 1)) - n) Next i decrypt = pInput End Function -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "basil" wrote in message ... Hello Is their a macro around that well do roto13 code? thanks Basil |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
roto13
It may also be ROT135. In other words, letters ("A".."Z" and "a".."z") are
rotated 13 character positions, and digits are rotated 5 positions. Digit Becomes 1 6 2 7 etc. I have a template that I use to do this that has the following function: '---------------------------------------------------------------------- 'ROT135 encodes/decodes text that has been encoded using the ROT135 algorithm. 'Letters "A" thru "M" rotate down the alphabet to become "N" thru "Z" (13 places). 'Letters "N" thru "Z" rotate back around (wrap around) to "A" thru "M". 'Digits rotate 5 places, so that "0" thru "4" become "5" thru "9", 'and digits "5" thru "9" become "0" thru "4". 'If the input argument Text is a number, the encoded/decoded version 'is returned as a string. Use the VALUE worksheet function on the return 'value of ROT135 if a numerical result is needed. Public Function ROT135(Text As String) As String Dim strBuffer As String Dim lngTextLength As Long Dim lngIndex As Long Dim strCharacter As String lngTextLength = Len(Text) strBuffer = "" If lngTextLength 0 _ Then 'Check and convert each character. For lngIndex = 1 To lngTextLength strCharacter = Mid$(Text, lngIndex, 1) Select Case strCharacter 'Rotate letters 13 places. Case "A" To "M", "a" To "m" strBuffer = strBuffer & Chr$(Asc(strCharacter) + 13) Case "N" To "Z", "n" To "z" strBuffer = strBuffer & Chr$(Asc(strCharacter) - 13) 'Rotate digits 5 places. Case "0" To "4" strBuffer = strBuffer & Chr$(Asc(strCharacter) + 5) Case "5" To "9" strBuffer = strBuffer & Chr$(Asc(strCharacter) - 5) 'Character is a punctuation symbol; skip the conversion. Case Else strBuffer = strBuffer & strCharacter End Select Next lngIndex End If ROT135 = strBuffer End Function -- Regards, Bill Renaud |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
roto13
Thanks Bill
I will also try this out Basil "Bill Renaud" wrote in message . .. It may also be ROT135. In other words, letters ("A".."Z" and "a".."z") are rotated 13 character positions, and digits are rotated 5 positions. Digit Becomes 1 6 2 7 etc. I have a template that I use to do this that has the following function: '---------------------------------------------------------------------- 'ROT135 encodes/decodes text that has been encoded using the ROT135 algorithm. 'Letters "A" thru "M" rotate down the alphabet to become "N" thru "Z" (13 places). 'Letters "N" thru "Z" rotate back around (wrap around) to "A" thru "M". 'Digits rotate 5 places, so that "0" thru "4" become "5" thru "9", 'and digits "5" thru "9" become "0" thru "4". 'If the input argument Text is a number, the encoded/decoded version 'is returned as a string. Use the VALUE worksheet function on the return 'value of ROT135 if a numerical result is needed. Public Function ROT135(Text As String) As String Dim strBuffer As String Dim lngTextLength As Long Dim lngIndex As Long Dim strCharacter As String lngTextLength = Len(Text) strBuffer = "" If lngTextLength 0 _ Then 'Check and convert each character. For lngIndex = 1 To lngTextLength strCharacter = Mid$(Text, lngIndex, 1) Select Case strCharacter 'Rotate letters 13 places. Case "A" To "M", "a" To "m" strBuffer = strBuffer & Chr$(Asc(strCharacter) + 13) Case "N" To "Z", "n" To "z" strBuffer = strBuffer & Chr$(Asc(strCharacter) - 13) 'Rotate digits 5 places. Case "0" To "4" strBuffer = strBuffer & Chr$(Asc(strCharacter) + 5) Case "5" To "9" strBuffer = strBuffer & Chr$(Asc(strCharacter) - 5) 'Character is a punctuation symbol; skip the conversion. Case Else strBuffer = strBuffer & strCharacter End Select Next lngIndex End If ROT135 = strBuffer End Function -- Regards, Bill Renaud |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|