A | B | C | |
---|---|---|---|
Original | Encrypted | Decrypted | |
abd | xxxQQX | abd | |
xxx | |||
xxx | |||
yjm5616-651yu | xxxIY_ KE | yjm5616-651yu |
as need urgently...
Excel 2010 | ||||
---|---|---|---|---|
A | B | |||
2 | 750 | HKE | ||
Sheet2 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B2 | =Enc(A2,"BLACKWHITE") |
Function Enc(sData As String, sKey As String)
Dim temp As String
Dim i As Long
If Len(sKey) > 10 Then Enc = "Invalid Key Length"
For i = 1 To Len(sData)
temp = temp & Mid(sKey, Replace(Mid(sData, i, 1), "0", "10"), 1)
Next i
Enc = temp
End Function
Function Encr(sData As String, sKey As String) As String
Dim i As Long
If Len(sKey) < 10 Then
Encr = "Ivalid key length"
Else
sKey = Mid(sKey, 10, 1) & sKey
For i = 1 To Len(sData)
Encr = Encr & Mid(sKey, Mid(sData, i, 1) + 1, 1)
Next i
End If
End Function
Excel Workbook | ||||
---|---|---|---|---|
A | B | |||
1 | 750 | HKE | ||
2 | 901256 | TEBLKW | ||
3 | 3265 | Ivalid key length | ||
Sheet2 |
Welcome to the MrExcel board!Can you please explain in detail how to implement this code.