I want to make a very basic text encoder to change a text string to a long number. (Yes I know its not very secure!)
This is what I have so far but I cant get the VLookup to work properly...
Sub encode1()
Dim Counter As Integer
Dim MyString As String
Dim NewString As String
Dim NextChar As String
Dim Key As Integer
MyString = Cells(1, 1)
Key = inputbox("Enter Key")
For Counter = 1 To Len(MyString)
range1 = Mid(MyString, Counter, 1)
NextChar = Application.VLookup(Range(range1), Range("y1:z95"), 2, 0)
NewString = NewString & NextChar
Next
'convert newstring to number?
'NewString = NewString * Key
Cells(3, 1) = NewString
End Sub
The Text to encode is in A1 and the table to lookup is Y1:Z95
If you have any suggestions of other ways to do it please bear in mind I do need the output to be all numbers, not other odd characters.
Bookmarks