Question : find and replace characters within a feild or cell

Hello,

We are trying to solve a data text problem using excel. At the moment we have data that appears within a cell that has been encrypted using a basic form of lookup and replace for each character within a cell.

Ie David = {tr4{

We would like to reverse the process and convert the encypted characters back into its original state via a character lookup table.

Ie
{ = D
t = a
r = v
4 = i

therefore {tr4{ = David

Is there a way that this can be achieved within excel ?

Answer : find and replace characters within a feild or cell

You could write a custom function such as the one I've put together below..  Add more bits in the 'Select Case' section to decode more characters.

HTH
Matt
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:
Public Function DecodeText(mytext As String)

Dim intLength As Integer
Dim i
Dim strCurrentLetter As String
Dim strNewText As String

intLength = Len(mytext)

For i = 1 To intLength
    strCurrentLetter = Mid(mytext, i, 1)
    
    Select Case strCurrentLetter
        Case "{"
            strNewText = strNewText & "D"
        Case "t"
            strNewText = strNewText & "a"
        Case "r"
            strNewText = strNewText & "v"
        Case "4"
            strNewText = strNewText & "i"
        Case Else
            'Do nothing
            'Add more 'Case' statements above to convert more letters that are encoded
    End Select
Next

DecodeText = strNewText

End Function
Random Solutions  
 
programming4us programming4us