View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
exceluserforeman
 
Posts: n/a
Default Color a single digit in a mult-digit number cell

Public Sub ColorMyCellDigits()
Dim intLen, i As Integer
If ActiveCell.Value = "" Then
Exit Sub
End If
ActiveCell.Select
Set A = Selection
intLen = Len(A.Value)

For i = 1 To intLen
If Mid(A.Value, i, 1) = 3 Then
A.Characters(i, 1).Font.Bold.Color = vbRed

End If
Next

"Phyllis" wrote:

Suggestion for Microsoft

I would like to be able to format a single digit in a number cell that
contains 2 or more digits. For example, if I type 346 in a cell, I would like
to be able to bold or color just one of the digits, say the 3. The reason:
to help me test a theory. If the solution to a problem could be either a 3,
4, or 6 in a given cell, I migth want to test the theory that it's the 3. If
I could color the 3 in the cell containing 346, and then color the resulting
answer in other cells, I could track all the changes I made to test the
theory without erasing the other possible variables incase my theory is
wrong. Yes, I confess, it's to help me solve a five-star (highest
difficulty) Sudoku puzzle.

Other suggestions for testing a theory without eliminating the variables are
welcome. Programming an IF logic sequence would be too complex. (I've tried
just bracketing the theoretical numbers, but it gets clumsy, confusing and
cumbersome.)
--
PT




--
PT

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...lic.excel.misc