+ Reply to Thread
Results 1 to 18 of 18

A macro for crypto!!!

  1. #1
    Registered User
    Join Date
    03-04-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2007
    Posts
    27

    A macro for crypto!!!

    Hello everyone. I just want to say that this macro will make many things easier for me. Let me explain.

    I'm going to write a novel or say some kind of thing like that and I need a private language which make it only readable for myself. Lets say :

    an "a" in my own language will be "d" actually. And a "b" means "r" and like these examples, all letters in my own language will nominate another letter. Is there a way to do this ? I will work in Microsoft Word and I want to paste my writings to a cell in excel and when I start the macro it will change the writings into another cell.

    Lets say when I paste this sentence into cell a1 :

    "Today is the best day in order to..."

    and started the macro I want to get this sentence in cell a2

    "Ahntı pu aov kvua ntı hznvz ah..."

    Is it possible ?

    Thanks in advance.
    Last edited by erguntmzkn; 05-12-2013 at 09:54 AM. Reason: typo

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: A macro for crypto!!!

    See the attached for an example. It is a simple substitution cypher mapping characters ASCII 32 thru ASCII 255. Tab "substitution" column D is the input character and column E is the output character.

    Tab "sample" cell A1 is an input and B1 is an output.
    Attached Files Attached Files
    Gary's Student

  3. #3
    Registered User
    Join Date
    03-04-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: A macro for crypto!!!

    Thanks for your reply. But actually I want to create my own language and I want to identify my own characters myself. And the basic idea of this crypto should be this:
    When I type
    "Today is the best day in order to..."
    it should give me the result
    "Ahntı pu aov kvua ntı hznvz ah..."

    and also when I type
    "Ahntı pu aov kvua ntı hznvz ah..."

    the result should be

    "Today is the best day in order to..."

    Thanks a lot.

  4. #4
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: A macro for crypto!!!

    Then you need to supply me a complete list of the translation table............similar to what I supplied in cols D & E.

    If we assume that blanks and special characters are not translated, you only need to supply a table with 26 entries.

  5. #5
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: A macro for crypto!!!

    Here is the UDF that will perform the translation:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-04-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: A macro for crypto!!!

    Thank you. So let's say ;

    a-b-c-ç-d-e-f-g-ğ-h-ı-i-j-k-l-m-n-o-ö-p-r-s-ş-t-u-ü-v-y-z
    r-ı-e-ç-s-a-f-u-z-i-ö-h-d-c-g-b-ğ-p-y-o-j-l-ş-v-n-ü-m-k-t

    and

    A-B-C-Ç-D-E-F-G-Ğ-H-I-I-J-K-L-M-N-O-Ö-P-R-S-Ş-T-U-Ü-V-Y-Z
    R-I-E-Ç-S-A-F-U-Z-I-Ö-H-D-C-G-B-Ğ-P-Y-O-J-L-Ş-V-N-Ü-M-K-T.

    And for the punctuations like "." or "," you can use your own symbols. Or for the numbers you can use yours also.
    Additionally when I paste your code into my personal visual basic workbokk I can not perform the code. Does this have a reason ?

    Thank you.

  7. #7
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: A macro for crypto!!!

    I am having a problem in the translation of upper case characters. In you latest post, you have upper case I entered twice:

    A-B-C-Ç-D-E-F-G-Ğ-H-I-I-J-K-L-M-N-O-Ö-P-R-S-Ş-T-U-Ü-V-Y-Z

  8. #8
    Registered User
    Join Date
    03-04-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: A macro for crypto!!!

    It should be "İ" sorry.

  9. #9
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: A macro for crypto!!!

    Your new translation table is now in columns A & B of the xlt tab.
    The Data tab shows some examples of the translation.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    03-04-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: A macro for crypto!!!

    Thank you. You're great.

  11. #11
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: A macro for crypto!!!

    Thank you for the feedback!

  12. #12
    Registered User
    Join Date
    03-04-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: A macro for crypto!!!

    By the way is there a limit o max letter value for a single cell ?

  13. #13
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: A macro for crypto!!!

    Do you mean limiting the number of characters the function will return??

  14. #14
    Registered User
    Join Date
    03-04-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: A macro for crypto!!!

    Yes. Does it have a limit ? Or not ?

  15. #15
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: A macro for crypto!!!

    There is no limit in Code2.xlsm.

    What limit do you desire?

  16. #16
    Registered User
    Join Date
    03-04-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: A macro for crypto!!!

    No I don't want any. Thanks again.

  17. #17
    Registered User
    Join Date
    03-04-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: A macro for crypto!!!

    Oh sorry I have another question. I didn't want to post another thread.
    I need a macro that sets the value of selected cell to the cell in column "B" which has the same row number with selected cell.
    Example :

    When I run the macro when the cell A3 is selected it should make the A3 equal to B3. (selected cell still should be A3)
    Or when T39 is selected macro should make the value of the cell as B39. (And after the process the selected cell should be still T39.

    Thanks in advance.

  18. #18
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: A macro for crypto!!!

    Try this:

    Please Login or Register  to view this content.

+ 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