+ Reply to Thread
Results 1 to 4 of 4

Simple translating VBA program find and replace

  1. #1
    Registered User
    Join Date
    09-26-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    4

    Simple translating VBA program find and replace

    Hello everyone,

    I have the following attached excel sheet. I have just begun using VB in excel and was wondering how to go about this. In sheet 1, I want the user to use the vocabulary on the top, and type any of those words (all in lowercase) into the textbox next to "English". When the user clicks the commandbutton labeled "Translate" I want it to find the values in sheet 2, Column B for French, and I want it to print in the textbox in sheet 1 next to French, the words in french. Could anyone shed some guidance as to how to start this? Thanks!practice.xls

  2. #2
    Registered User
    Join Date
    11-25-2008
    Location
    Poland
    MS-Off Ver
    MSO 2K3, 2K10
    Posts
    84

    Re: Simple translating VBA program find and replace

    In Sheet1 module:
    Please Login or Register  to view this content.
    Artik

  3. #3
    Registered User
    Join Date
    09-26-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Simple translating VBA program find and replace

    Thanks for your input Artik,

    I didn't mention earlier, but it's supposed to allow the user to type multiple words to form simple sentences. However your code is only allowing one word at a time.

    Currently I'm doing:
    A = Replace(TextBox1, "the", "la")
    A = Replace(A, "is", "est")
    A = Replace(A, "on", "sur")
    A = Replace(A, "my", "mon")
    A = Replace(A, "yellow", "jaune")
    A = Replace(A, "red", "rouge")
    A = Replace(A, "friend", "ami")
    A = Replace(A, "sick", "malade")
    A = Replace(A, "hat", "chapeau")
    A = Replace(A, "pencil", "crayon")
    A = Replace(A, "table", "table")

    B = Replace(TextBox1, "the", "dem")
    B = Replace(B, "is", "ist")
    B = Replace(B, "on", "auf")
    B = Replace(B, "my", "mein")
    B = Replace(B, "yellow", "gelb")
    B = Replace(B, "red", "rot")
    B = Replace(B, "friend", "freund")
    B = Replace(B, "sick", "krank")
    B = Replace(B, "hat", "hut")
    B = Replace(B, "pencil", "bleistift")
    B = Replace(B, "table", "tisch")

    TextBox2.Value = A
    TextBox3.Value = B

    This doesn't use the 2nd sheet at all, and also am pretty darn sure there's a much more easier way to put it. Thanks guys!

  4. #4
    Registered User
    Join Date
    11-25-2008
    Location
    Poland
    MS-Off Ver
    MSO 2K3, 2K10
    Posts
    84

    Re: Simple translating VBA program find and replace

    s'il vous plaît
    Please Login or Register  to view this content.
    Artik

+ 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