1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| Sub test()
Dim txt As String
txt = "Comme je l'ai déjà dit, ce n'est pas mon code, ce n'est pas moi qui l'ai fait mais un des camarades de ma fille."
txt = txt & vbCrLf & "Je vous l'ai juste exposé, c'est tout."
txt = txt & vbCrLf & "Je suis intervenu pour faire une demande d'aide au tout début, et pour finir le code pour la mise en minuscules, pour le reste, je n'y suis pour rien."
txt = txt & vbCrLf & "c 'est leur devoir, ils prennent leur responsabilité."
txt = txt & vbCrLf & "Je ne sais même pas si il connaît Vba, ce n'est pas mon affaire. Je ne porte pas de jugement sur ce qu'ils ont fait je ne suis pas leur prof."
txt = txt & vbCrLf & ""
txt = txt & vbCrLf & "Maintenant , c 'est fait..."
txt = txt & vbCrLf & ""
txt = txt & vbCrLf & "Je le répète, ce n'est plus mon affaire. La discussion est close."
txt = txt & vbCrLf & ""
txt = txt & vbCrLf & "Merci à tous d'avoir participé à cette discussion."
txt = txt & vbCrLf & "Bonne fin de journée"
txt = CodageDecodage(txt)
MsgBox txt
MsgBox CodageDecodage(txt)
End Sub
Function CodageDecodage(txt As String) As String
Dim T()
T = Array(41, 37, 39, 36, 35, 33, 32, 34, 46, 32, 45, 47, 44, 42, 40, 43, 55, 53, 52, 56, 50, 49, 57, 48, 51, 54, 64, 65, 61, 59, 63, 62, 58, 59, _
86, 76, 71, 83, 80, 68, 90, 84, 77, 97, 67, 74, 88, 85, 70, 89, 87, 69, 73, 79, 66, 82, 78, 81, 72, 94, 96, 95, 91, 93, 92, 75, 119, 110, _
122, 113, 115, 107, 112, 117, 120, 103, 114, 118, 99, 116, 104, 101, 108, 102, 111, 105, 109, 98, 106, 123, 100, 121, 124, 121, _
126, 127, 128, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, _
153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, _
179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, _
205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, _
232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 255)
CodageDecodage = txt
For i = 1 To Len(txt)
If Asc(Mid(txt, i, 1)) <> 13 And Asc(Mid(txt, i, 1)) <> 10 Then Mid(CodageDecodage, i, 1) = Chr(T(Asc(Mid(txt, i, 1)) - 32))
Next
End Function |
Partager