View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Michael Kimmerly Michael Kimmerly is offline
external usenet poster
 
Posts: 2
Default Cell Fill Colors

Thanks Bob. Will study the code, been years since I used VB or VBA, but I
assumed it could be done that way. A co-worker thought standard or
conditional formatting could do it but I could not figure a way. Much
Appreciated.




On 1/31/07 10:28 AM, in article , "Bob
Phillips" wrote:

Not without VBA.

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit
Dim i As Long

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
For i = 1 To Len(.Value)
If IsNumeric(Mid(.Value, i, 1)) Then
.Characters(i, 1).Font.Bold = True
End If
Next i
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click