+ Reply to Thread
Results 1 to 23 of 23

Changing font colour based on a character

  1. #1
    Registered User
    Join Date
    08-04-2014
    Location
    Harrogate
    MS-Off Ver
    2016
    Posts
    17

    Post Changing font colour based on a character

    Hi Guys

    I have a list of values that are output to cell D67 in the form of

    Name1, Name2

    or

    Name1, Name2, .... Name10, Name11

    or

    Name1, Name2, ...,,,,,,,,,,,,,,,,,... Name30, Name31

    Number of names varies but each one is separated by a comma

    Is is possible to change the font colour after each comma

    Name1, Name2, .... Name10, Name11


    Thanks for looking

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Changing font colour based on a character

    Try this
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-04-2014
    Location
    Harrogate
    MS-Off Ver
    2016
    Posts
    17

    Re: Changing font colour based on a character

    Hello jindon

    Thanks for your help

    I have added your code but the output is not changing I added it as a module.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Changing font colour based on a character

    Dose D67 contain formula?

    If so, you need to convert it to Value.

    Can not partially format the cell when it has formula or numeric value.

  5. #5
    Registered User
    Join Date
    08-04-2014
    Location
    Harrogate
    MS-Off Ver
    2016
    Posts
    17

    Re: Changing font colour based on a character

    Yes it does sorry

  6. #6
    Registered User
    Join Date
    08-04-2014
    Location
    Harrogate
    MS-Off Ver
    2016
    Posts
    17

    Re: Changing font colour based on a character

    Hi Jindon

    I am having trouble converting to text, can it be done within your code by adding

    D67 = CSTR(D67)

    I don't seem to be able to get it to work
    Thanks for your help

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Changing font colour based on a character

    Add one line
    Please Login or Register  to view this content.
    Range("D67") and [D67] are the same in this case.

  8. #8
    Registered User
    Join Date
    08-04-2014
    Location
    Harrogate
    MS-Off Ver
    2016
    Posts
    17

    Re: Changing font colour based on a character

    Hi Jindon


    I am still having no luck

    I have uploaded my workbook to https://onedrive.live.com/redir?resi...=folder%2cxlsm

    as I cannot attach it here,

    as you will see I have now moved to cell C11

    Thanks

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Changing font colour based on a character

    You should re-build a workbook.
    It tells only 304k in the property, but takes a few minutes to open and says , fixing and opening....

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    08-04-2014
    Location
    Harrogate
    MS-Off Ver
    2016
    Posts
    17

    Re: Changing font colour based on a character

    Thanks again, I have added as a module but I am still not able to get it to work

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Changing font colour based on a character

    .............................
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    08-04-2014
    Location
    Harrogate
    MS-Off Ver
    2016
    Posts
    17

    Re: Changing font colour based on a character

    thank you I will rebuild and see

    your help is greatly appeciated

  13. #13
    Registered User
    Join Date
    08-04-2014
    Location
    Harrogate
    MS-Off Ver
    2016
    Posts
    17

    Re: Changing font colour based on a character

    Jindon has been kind enough to supply the following code which works fine

    Please Login or Register  to view this content.

    However it will only change the font color once and then it stops C11 being updated.

    Is there anyway to run module automatically when C11 is updated

    Thanks
    Last edited by pjzapped; 03-26-2016 at 11:43 AM.

  14. #14
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Changing font colour based on a character

    Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  15. #15
    Registered User
    Join Date
    08-04-2014
    Location
    Harrogate
    MS-Off Ver
    2016
    Posts
    17

    Re: Changing font colour based on a character

    Apologies shg

  16. #16
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Changing font colour based on a character

    No problem, thank you.

  17. #17
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Changing font colour based on a character

    I need to see your re-build workbook to know how you update C11.

    I couldn't open your uploaded file properly.

  18. #18
    Registered User
    Join Date
    08-04-2014
    Location
    Harrogate
    MS-Off Ver
    2016
    Posts
    17

    Re: Changing font colour based on a character

    Hello Jindon

    Thanks again
    I have uploaded my rebuild to https://onedrive.live.com/redir?resi...nt=file%2cxlsm

    \the cell c11 is updated based on the value in B5 and so I need some way to convert back from values so it will update

  19. #19
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Changing font colour based on a character

    Add the code to sheet module
    Please Login or Register  to view this content.

  20. #20
    Registered User
    Join Date
    08-04-2014
    Location
    Harrogate
    MS-Off Ver
    2016
    Posts
    17

    Re: Changing font colour based on a character

    Hello

    I have added your code as a new module, but the C11 cell is not being formatted, can you add it to the online file so I can see where I have gone wrong

    Thanks
    Last edited by pjzapped; 03-27-2016 at 06:48 AM.

  21. #21
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Changing font colour based on a character

    The code will execute only when you change any value in f23:f61, since the formula in D67 calculates that range.
    And the code will convert C1 formula to value, C1 will never change unless you enter =D67 mannualy again.

    Are you expecting changing the format with formula intact?, That's simply impossible.

  22. #22
    Registered User
    Join Date
    08-04-2014
    Location
    Harrogate
    MS-Off Ver
    2016
    Posts
    17

    Re: Changing font colour based on a character

    Ok, now I understand, thanks so much for all your help, your code has taught me some new techniques I was not aware of

    Sorry to have taken up your time

  23. #23
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Changing font colour based on a character

    No problem.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 01-02-2015, 09:18 AM
  2. Getting Colour wise totals by changing font colour
    By Anuru in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-24-2014, 11:13 AM
  3. [SOLVED] Changing Font colour via formula
    By coach.32 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-07-2013, 06:52 PM
  4. Changing the colour of one character
    By lewgill in forum Excel General
    Replies: 1
    Last Post: 06-10-2013, 11:28 AM
  5. Replies: 7
    Last Post: 04-09-2012, 04:27 PM
  6. Changing font colour
    By Peter Rump in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-28-2006, 01:08 PM
  7. Changing font colour in some cells
    By Di W in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 03-12-2006, 02:10 PM

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