VBA Walkthrough #2: Message Encoder & Decoder

This VBA macro is hopefully a bit more interesting than the last, and shows how I created a message encryptor/decryptor in Excel using VBA/macros.

The lesson covers these specific areas of VBA usage:

– For…Next loop (including nested loops)

– If…ElseIf…Then Statement

– Excel functions: CHAR() / LEN() / VLOOKUP()

– VBA functions: Mod / Mid / Asc / Chr

Download the Message Encryptor & Decryptor here to follow along with the video lesson.

5 thoughts on “VBA Walkthrough #2: Message Encoder & Decoder

  1. Hi i just needed help, can you teach me how can i copy the PO i have generated to another worksheet without erasing the previous entry, (beginner homework number 2), i’ve already accomplished the copying part but somehow it overwrites the previous copied PO, what codes should i use in order to copy the new generated PO under the previous ones.

    here’s the code that i used

    Sub ButtonToCopy()

    ‘ ButtonToCopy Macro


    Range(“B2:N23”).Select
    Selection.Copy
    Sheets(“Sheet4”).Select
    Range(“A2:M23”).Select
    ‘I need to put here something like the “rowstart” to adjust the copied PO so it will not overwrite the previous ones

    ActiveSheet.Paste
    End Sub

    Thanks :D

  2. Hi i just needed help, can you teach me how can i copy the PO i have generated to another worksheet without erasing the previous entry, (beginner homework number 2), i’ve already accomplished the copying part but somehow it overwrites the previous copied PO, what codes should i use in order to copy the new generated PO under the previous ones.

    here’s the code that i used

    Sub ButtonToCopy()

    ‘ ButtonToCopy Macro


    Range(“B2:N23”).Select
    Selection.Copy
    Sheets(“Sheet4”).Select
    Range(“A2:M23”).Select <——-I need to put here something like the "rowstart" to adjust
    ActiveSheet.Paste the copied PO so it will not overwrite the previous ones
    End Sub

    Thanks :D

  3. Hi,

    Great post.

    I have managed to modify your VBA macro so that it includes batch encoding/decoding. But in terms of performance it’s very slow with large batches (seven strings with five characters per seconds). For small batches it works great.

    I was wondering if you had any recommendations for simple encoding and decoding, like the one you have here, but that would perform better with batch conversion.

    OS

    – Bergen

  4. Hi Ben, I would just like to show my appreciation via this comment as nobody has yet made a comment on this video and simply say – you are awesome!!!

    I don’t think I’ll be able to make the VBA you run throughout this video (not anytime soon anyway) but the fact that I can now even create a click button and simply ask ‘What is you name?’ and follow it with ‘How are you doing ‘VariableName’? is a good start – so thank you.

    SB
    London

Post any comments, feedback or questions below!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s