Results 1 to 8 of 8

Text Encoding

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-12-2007
    Posts
    144

    Text Encoding

    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.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1