+ Reply to Thread
Results 1 to 7 of 7

IF Then Printf

  1. #1
    Registered User
    Join Date
    11-23-2010
    Location
    Zagreb
    MS-Off Ver
    Excel 2003
    Posts
    21

    IF Then Printf

    I need some kind of formula for excel that will, as I am typing some letters will write another letters that I have previously defined. For example I have defined whole alphabet (“A" isn't an "A" but "TREE" "B" isn't "B" than "SUN" C=DOG so if I write "BAC" it will print SUN TREE DOG
    Thanks in advance
    Last edited by leveex; 11-25-2010 at 05:57 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: IF Than Printf

    Hello leevex,

    Welcome to the Forum!

    There isn't a formula to do what you want. You would have to use a VBA macro. The restriction with this your words could not be displayed until all the letters were entered. This assumes that you are using only single letters to represent the words. Would this this be an acceptable solution?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    11-23-2010
    Location
    Zagreb
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: IF Than Printf

    Quote Originally Posted by Leith Ross View Post
    Hello leevex,

    Welcome to the Forum!

    There isn't a formula to do what you want. You would have to use a VBA macro. The restriction with this your words could not be displayed until all the letters were entered. This assumes that you are using only single letters to represent the words. Would this this be an acceptable solution?

    That's exactly what I need. when I write whole word it display "code"
    Could You please help me with that macro?
    Thanks in advance

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: IF Then Printf

    Hello leveex,

    I can help with the code. I need to answer some other posts and then I will start writing the macro.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: IF Then Printf

    Hello leevex,

    This is a Worksheet Event macro. It will convert the letters into a phrase based on the individual characters that were typed in. None matching characters are ignored. If there are no matches then cell will be empty.

    The macro uses two named ranges Letters and Words. These are used to look up the word associated with a letter. You will need to create these ranges before running the macro. If you decide to name the ranges differently then be sure to change s the names in bold below to match.
    Please Login or Register  to view this content.
    How to Save a Worksheet Event Macro
    1. Copy the macro using CTRL+C keys.
    2. Open your Workbook and Right Click on the Worksheet's Name Tab for the Worksheet the macro will run on.
    3. Left Click on View Code in the pop up menu.
    4. Paste the macro code using CTRL+V
    5. Make any custom changes to the macro if needed at this time.
    6. Save the macro in your Workbook using CTRL+S

  6. #6
    Registered User
    Join Date
    11-23-2010
    Location
    Zagreb
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: IF Then Printf

    Thanks a lot
    Last edited by leveex; 11-25-2010 at 05:59 PM.

  7. #7
    Registered User
    Join Date
    11-23-2010
    Location
    Zagreb
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: IF Then Printf

    I managed, thanks for the effort and the script.

+ 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