How to write crosses from diffferent colors in different places in a range

I

imej-clavier

Hello,
Could somebody help me to solve my problem ?
I Would like to write alternatively a cross from a different color in a
range.
I have tried :
Set MaPlage = Application.Intersect(Range("AjoutX"), Target)
If Not MyRange Is Nothing Then
MyRange.Value = "X"
With Selection.font
.FontStyle = "Gras"
.ColorIndex = 3
.Size = 22
End With
End If
How must I do after to write in another case a cross from a different color
?

Thank you in advance,

Jean-michel
 
D

Debra Dalgleish

You can use Select Case to assign a colour. For example, to base the
colour on a value in the cell to the left:

'===============
With Selection.Font
.FontStyle = "Gras"
Select Case Target.Offset(0, -1).Value
Case Is < 100
.ColorIndex = 3
Case Is < 200
.ColorIndex = 5
Case Is < 500
.ColorIndex = 10
Case Else
.ColorIndex = 1
End Select
.Size = 22
End With
'==============
 
Top