+ Reply to Thread
Results 1 to 8 of 8

Change font colour of digits within numbers

  1. #1
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Change font colour of digits within numbers

    Hi

    Is there a way to change the font of a single digit within a number?

    I can select single characters in text strings and change the font to red while the other characters remain black, or I can do the same with a number if I convert it to text. But when I try to change the font colour of one digit in a number it reverts to black when I press enter.

    Eg

    Abcdefg
    1234567

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Change font colour of digits within numbers

    Hi,

    Not that I've come across unless it's a number that's stored as a text string.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Change font colour of digits within numbers

    thanks Dom, I suspected as much. Seems a bit odd to have this capability only for text strings.

    regards

    Nicky

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Change font colour of digits within numbers

    I have to admit in the years I've been on Excel forums your the first person I ever remember wanting to do that with numbers.

    Dom

  5. #5
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Change font colour of digits within numbers

    It’s only for personal use really – I’m trying to write a macro that will show different number combinations representing ‘forcing chains’ in hard Sudoku puzzles. Not most people’s idea of fun, I’ll admit!

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Change font colour of digits within numbers

    Can you not have the numbers in individual cells and colour them?

    Don't do Soduko so not really sure what you're trying to achieve but would expect it would also be easier to analyse.

    Dom

  7. #7
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Change font colour of digits within numbers

    Hi,

    I have been working on something similar over the past few months and its well developed now. My purposes are a little more extensive that what you are looking for, but the concept is the same. Several of my recent threads are devoted just for issues with this topic. My most up-to-date version can be found here. Also shg has provided a very good alternative here.

    I hope that you will be able to modify the code to your own needs. If you are having trouble, then post back and I will see what I can do.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  8. #8
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Change font colour of digits within numbers

    Hi Domski
    The cells contain several numbers representing possible values for that position. I could in theory have a different cell for each possible number, but that would mean rewriting my whole program, and increase the number of cells to manage from 81 to 700+

    Abousetta
    Interesting code, but again I think it only works for text strings, not for numbers

    I think my solution is to temporarily convert numbers to text for the purposes of this macro, then return them to numbers once the macro completes

    Cheers

    Nicky

+ 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