Bonjour a tous et toutes, forum bonjour,

Voila ce petit code me permets de changer la premiere lettre en majuscule gras et rouge dans la plage G2:H27. MAIS vous l'aurez deviner souci.

le code est a mon avis mal construit et il ne repond pas correctement a la demande.

Si quelqu'un svp veut bien me modifier le code, ca serai super gentil, car je ne trouve pas la cause

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
'*** CODE PREMIERE LETTRE MAJUSCULE GRAS et ROUGE ZONE G2:H27 
Private Sub Worksheet_Change(ByVal Target As Range) 
With Target 
If Not Intersect(Target, [G2:H27]) Is Nothing Then 
If .Count <> 1 Then Exit Sub 
Application.EnableEvents = False 
.Font.ColorIndex = 1 
.Font.Bold = False 
With Target.Characters(1, 1) 
.Font.ColorIndex = 3 
.Font.Bold = True 
.Text = UCase(.Text) 
End With 
Application.EnableEvents = True 
End If 
If Not Intersect(Target, [G2:H27]) Is Nothing And .Count = 1 Then 
If Target = "" Then 
.Font.ColorIndex = 1 
.Font.Bold = False 
End If 
End If 
End With 
End Sub
Merci a vous et de votre temps, une bonne journée

Raymond