Change Font name based on another cell value

  • Hi, i was having a hard time trying to make a code, I've tried using conditional format, but it can not change font names, only styles and colors.
    I'm using a userform, to fill some data. its a table of 5 columns, what i want is, that the font name of the 5th column text, changes depending on what 4th column text says. For example [TABLE="border: 1, cellpadding: 1, width: 500"]

    [tr]


    [td]

    A

    [/td]


    [td]

    B

    [/td]


    [td]

    C

    [/td]


    [td]

    D

    [/td]


    [td]

    E

    [/td]


    [/tr]


    [tr]


    [td]

    xxxx

    [/td]


    [td]

    yyyy

    [/td]


    [td]

    zzzzz

    [/td]


    [td]

    Normal

    [/td]


    [td]

    House

    [/td]


    [/tr]


    [tr]


    [td]

    yyy

    [/td]


    [td]

    zzzz

    [/td]


    [td]

    xxxx

    [/td]


    [td]

    Off

    [/td]


    [td]

    Tree

    [/td]


    [/tr]


    [tr]


    [td]

    yyy

    [/td]


    [td]

    xxxx

    [/td]


    [td]

    zzz

    [/td]


    [td]

    Small

    [/td]


    [td]

    Dog

    [/td]


    [/tr]


    [tr]


    [td]

    zzz

    [/td]


    [td]

    yyyyy

    [/td]


    [td]

    xxxx

    [/td]


    [td]

    Hard

    [/td]


    [td]

    Ball

    [/td]


    [/tr]


    [tr]


    [td]

    zzz

    [/td]


    [td]

    xxx

    [/td]


    [td]

    yyy

    [/td]


    [td]

    SFX

    [/td]


    [td]

    [FONT=verdana, geneva, sans-serif]Door[/FONT]

    [/td]


    [/tr]


    [tr]


    [td]

    NEW entry

    [/td]


    [td]

    xxx

    [/td]


    [td]

    yyy

    [/td]


    [td]

    Hard

    [/td]


    [td]

    Helicopter

    [/td]


    [/tr]


    [/TABLE]

    So basically what i want is if cell in D says" Normal", the Text on E column and same row (will be in v font.name) if it says "Off" (w font.name), "Small" will make it x font.name, "hard" will make it y font.name and "SFX" will make it (z font.name).
    And if i add a new entry, it will keep working, so everytime i add a new row, it will check that D row, and change the E row font name that it fits. I hope you can help me. Thanks.

  • Try the attached.


    There is a second sheet which has a list of the keywords with the font formatted to the required format for that keyword. The list is a Dynamic Named Range, named "Formats". You can edit that list without needing to change anything in the code, the additional sheet can be hidden.


    Code in the Worksheet Object Module for Sheet 1 is

    Files

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.