Font Color
On Jan 6, 6:46 pm, "Chip Pearson" wrote:
The code would go within your existing Worksheet_Change procedure. For
example,
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then
Exit Sub
End If
If Target.HasFormula = True Then
Exit Sub
End If
'''''''''''''''''''''''''''''''''''''''''''''
' Your existing code goes here.
'''''''''''''''''''''''''''''''''''''''''''''
End Sub
--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consultingwww.cpearson.com
(email on the web site)
wrote in message
...
On Jan 6, 6:07 pm, "Chip Pearson" wrote:
You very definitely want to avoid messing with the formulas. You can use
the
HasFormula property of a Range to see if there is a formula and get out
if
there is one. Also, you probably want to exit if Target has more than one
cell:
If Target.Cells.Count 1 Then
Exit Sub
End If
If Target.HasFormula = True Then
Exit Sub
End If
--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consultingwww.cpearson.com
(email on the web site)
wrote in message
...
On Jan 5, 7:14 am, Carim wrote:
Hi,
It cannot be done with formulas but with VBA :
Private Sub Worksheet_Change(ByVal Target As Range)
Set Target = Range("A1")
WithTarget.Characters(Start:=1, Length:=4).Font
.ColorIndex = 3
End With
WithTarget.Characters(Start:=5, Length:=12).Font
.ColorIndex = 5
End With
End Sub
HTH
Hi Carim,
I'm using your code and it works great for a cell with a text but if
there is in it mixed text and formula it does not seem to work.
What I'm doing wrong?
Bye, Stefano.
Sorry, I'm not sure to understand what I have to do. Where I need to
insert the two If statement?
Thanks a lot the same, Chip.
Bye, Stefano.
|