1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Sub codage()
alpha = Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
p = UCase(InputBox("saisir la chaine de caractères à coder"))
For i = 1 To Len(p)
For j = 0 To UBound(alpha)
If Mid(p, i, 1) = alpha(j) Then
x = x & " " & alpha((3 * j + 2) Mod 26)
End If
Next
Next
MsgBox x 'qui renvoi une codification de la chaine saisie dans l'alphabet
With Worksheets("Texte"): Set Plage = .Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)): End With
Set Cel = Plage.Find(p, xlValues, xlWhole)
If Cel Is Nothing Then MsgBox "Texte inconnu !": Exit Sub
If Cel.Offset(, 1).Value = p Then
Cel.Offset(, 7).Value = x '<--- Texte MsgBox va en H
End If
End Sub |
Partager