+ Reply to Thread
Results 1 to 6 of 6

Scramble and Unscramble a message

  1. #1
    Registered User
    Join Date
    03-11-2010
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    7

    Smile Scramble and Unscramble a message

    Hi,

    I have an excel file like this with all the alphabet letters:

    Original character Changed character
    a e
    b v
    c d
    d I
    e z


    I need two write two subs, Scramble and Unscramble. In each, ask the user for a message in an input box. In the Scramble sub, this will be an original message; in the Unscramble sub, it will be a scramble message. Then in the Scramble sub, scramble the message and display it. In the unscramble sub, unscramble the message and display it.

    I would appreciate any help or can anyone point me in the right direction.

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Scramble and Unscramble a message

    Hi Natygrosso,

    Please review the updated spreadsheet. Click the Scramble button to enter normal words and have them scrambled based on the value conversion from column A to B. Click the Unscramble button to enter a scrambled message and perform a conversion from column B to A.

    The way this is setup is that when scrambling a letter it looks for the letter in column A and returns the "changed character" from column B. When unscrambling, it looks for the letter in column B and returns the "original character" from column A.

    For example:
    Scramble the word "Paul" and you get "Iewq"
    Unscramble the text "Iewq" and you get "Paul"

    You could set it up another way, such that it looked for the letters "Iewq" in column A and returned new changed characters from column B, but that could get confusing (especially if you're trying to get back to the original word/phrase).

    The Scramble and Unscramble macros only differ by one line, and there are probably easier ways to do this than using Dictionary Scripting Objects and an array... but Leith helped me with a word/character replacement macro several weeks ago using this method, and I wanted to take some time to try to write one myself.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Hope that helps!
    Attached Files Attached Files

  3. #3
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Scramble and Unscramble a message

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!

  4. #4
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    Re: Scramble and Unscramble a message

    HI
    it is certainly distressing to find the time and effort spent on finding a solution has been misspent.
    See the attached file for my approach to the problem
    Ravi
    Last edited by teylyn; 03-12-2010 at 04:04 AM.

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Scramble and Unscramble a message

    ravishankar: Do not post a reply to a thread where a moderator has requested an action that has not been complied with e.g Title change or Code tags...etc

  6. #6
    Registered User
    Join Date
    03-11-2010
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Scramble and Unscramble a message

    I want to apologize to everyone that got affected by my mistake. I didn't mean any harm or wasting anyones time. It was plain ignorance on the forum subject. I assure that the lesson was learned and it would never happen again.Thank you very much for everyones help it is greatly appreciate it.
    Thank you

    Naty

+ Reply to Thread

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