+ Reply to Thread
Results 1 to 4 of 4

VBA Crypto solving

  1. #1
    Registered User
    Join Date
    07-20-2012
    Location
    Hawaii
    MS-Off Ver
    Excel 2007
    Posts
    2

    VBA Crypto solving

    I am trying to solve some simple crypto, that looks something like this;

    cells 1,1 has the alphabet and cells 1,2 has the key.
    a = z
    b = y
    c = x

    this is my long drawn out code for 1 cell.

    Please Login or Register  to view this content.
    ect...

    is there an easier way? please help.

    Thank you,

    Sean
    Last edited by Cutter; 07-20-2012 at 10:33 PM. Reason: Added code tags

  2. #2
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: VBA Crypto solving

    Depending on how you are going to use it I would create a 2 dimensional array - assume A-Z is in column A and Z-A is in column B
    Please Login or Register  to view this content.
    The first dimension of the array cryArr(n,1) is column A and the second dimension is cryArr(n,2)
    So if you loop through the array to find A
    Please Login or Register  to view this content.
    In this case the letter you would look for would be a variable so you would not loop through to find A but rather find a string variable. For example
    Please Login or Register  to view this content.
    Hope that makes sense
    Last edited by smuzoen; 07-21-2012 at 12:21 AM.
    Hope this helps.
    Anthony
    Pack my box with five dozen liquor jugs
    PS: Remember to mark your questions as Solved once you are satisfied. Please rate the answer(s) by selecting the Star in the lower left next to the Triangle. It is appreciated?

  3. #3
    Registered User
    Join Date
    07-20-2012
    Location
    Hawaii
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: VBA Crypto solving

    Thank you for the two dimentional array. I think (95%) I understand the code, but to apply it, is where i get fuzzy. Colum A = A-Z Colum B = Z-A. how do I input, say (hvcm = sean). Can I put hvcm in cell c1 or do I need to use a seperate cell for each letter.

    Please be patiant with me, I know enough to be dangerous (to myself), I'm still trying to learn VBA/codding in general.

    Thanks again for your help!!!!

    Sean

  4. #4
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: VBA Crypto solving

    In your example hvcm would equate to sexm however hvzm would equate to sean.
    You could enter the code you want to convert into C1 and use
    Please Login or Register  to view this content.
    See attached workbook - if you want to ask any questions about the code let me know
    Attached Files Attached Files
    Last edited by smuzoen; 07-21-2012 at 05:18 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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