bonjour
j'ai cherché pas mal dans les forums sans succès.
je souhaiterai que cellule E15 change de couleur non pas lorsque l'on écrit dedans pour la 1ere fois mais seulement à la deuxième.
en résumé si j'écrit des données en E15 pour le 1ere fois celles ci sont de couleur rouge et si je fais un modif les données apparaissent en noir.
je précise que les MFC ne sont pas possibles car je ne sais pas à l'avnce ce qui pourra être inscrit
un grand merci par avance
seb
j'ai essayé d'adapter ton code dans mon fichier mais il y a un hic car j'ai déjà un code dans mon onglet et le mix ne se fait pas
Sais tu comment joindre ton code au mien sans qu'il y ait de bug stp ?
ci-dessous mon code actuel
***
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("M2")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
If Not Application.Intersect(Target, Range("A5")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
If Not Application.Intersect(Target, Range("Q6")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
If Not Application.Intersect(Target, Range("Q8")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
If Not Application.Intersect(Target, Range("M5")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
If Not Application.Intersect(Target, Range("AA5")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
If Not Application.Intersect(Target, Range("E15")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
If Not Application.Intersect(Target, Range("AE6")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
If Not Application.Intersect(Target, Range("AE14")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
If Not Application.Intersect(Target, Range("AE15")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
If Not Application.Intersect(Target, Range("AE16")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
If Not Application.Intersect(Target, Range("AE17")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
If Not Application.Intersect(Target, Range("A20")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
If Not Application.Intersect(Target, Range("U20")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
If Not Application.Intersect(Target, Range("A24")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
If Not Application.Intersect(Target, Range("U24")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
Juste une autre idée qui va fonctionner avec toutes les cellules qui auront été mises en rouge :
VB:
Private Sub Worksheet_Change(ByVal Target As Range)
With Target.Range("a1")
If .Font.Color = RGB(255, 0, 0) Then
.Font.Color = RGB(254, 0, 0)
ElseIf .Font.Color = RGB(254, 0, 0) Then
.Font.Color = RGB(0, 0, 0)
End If
End With
End Sub
je crois comprendre...
j'ai déverrouillé la cellule AZ1 mais mon onglet est toujours protégé.
le hic c'est que je veux garder la protection sur la feuille.
le code est il modifiable d'apres toi ?
merci
seb
c'est çà le hic en fait .
Dans mon fichier la cellule AZ1 (qui est déverouillée) ne copie les données comme dans ton fichier test. c'est pourtant un copie coller de ton code que j'ai collé
vois tu une solution stp
un grand merci par avance
seb