Simpatie.ro - matrimoniale
Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Nou pe simpatie:
Ana Maria 25 pe Simpatie
Femeie
24 ani
Bucuresti
cauta Barbat
35 - 68 ani
Mrrrr's Forum (VIEW ONLY)ReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides /

[EXCEL] ROT-13 Encryption [VBA]

Pagini: 1 Moderat de TRaP, TonyTzu
#1
Mrrrr
AdMiN
Postari: 2388
Source:
https://www.mrexcel.com/board/threads/m ... 13.367062/


' DEFAULT IS ROT-13, if you make the formula =ROT(TEXT;7) it will do ROT-7
Public Function ROT(ByVal s As String, Optional ByVal r As Integer = 13) As String
    Dim c, f, i As Integer
    For i = 1 To Len(s)
        c = Asc(Mid(s, i, 1))
        If (c >= 97 And c <= 122) Or (c >= 65 And c <= 90) Then
            If c >= 97 Then f = 97 Else f = 65
            c = r + c - f
            Do: c = c Mod 26: Loop While c > (26 - 1)
            c = c + f
        End If
        ROT = ROT & Chr(c)
    Next i
End Function


_______________________________________


 
   
Pagini: 1  
Mergi la