Re: Help (cesar code)

Tech-Archive recommends: Speed Up your PC by fixing your registry



Here are a couple of functions that will encrypt and encrypt a whole word
that you can use

Function Encrypt(text As String)
Dim i As Long
Dim sTemp As String

For i = 1 To Len(text)
sTemp = sTemp & Chr(Asc(Mid(text, i, 1)) - 1)
Next i

Encrypt = sTemp
End Function


Function Decrypt(text As String)
Dim i As Long
Dim sTemp As String

For i = 1 To Len(text)
sTemp = sTemp & Chr(Asc(Mid(text, i, 1)) + 1)
Next i

Decrypt = sTemp
End Function



--

HTH

RP
(remove nothere from the email address if mailing direct)


"oS_Narley" <oS_Narley.1rpq6v_1120594032.5605@xxxxxxxxxxxxxxxxxxxxx> wrote
in message news:oS_Narley.1rpq6v_1120594032.5605@xxxxxxxxxxxxxxxxxxxxxxxx
>
> Hello
>
> I am having a little problem, i know what i want to do with excel but i
> dont no where to start, i dont no what formula to use, what i am after
> is a spread*** to encrypt and decrpt 'cesar code'.
>
> cesar code - e.g IBM becomes HAL, it take the letter before the letter
> and replaces it, i hope you undertsand that, like H is 1 letter before
> I and A is before B etc.
>
> how could i do this with Excel?
>
> Thanks very much
>
> oS_Narley
>
>
> --
> oS_Narley
> ------------------------------------------------------------------------
> oS_Narley's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=24928
> View this thread: http://www.excelforum.com/showthread.php?threadid=384649
>


.


Quantcast