anthoYS
XLDnaute Barbatruc
Bonjour,
Si date en B3 colorer de jaune A3, si date en G3 même s'il y a des dates avant, colorer A3 de vert fluo.
code à améliorer... :
	
	
	
	
	
		
Merci !
	
		
			
		
		
	
				
			Si date en B3 colorer de jaune A3, si date en G3 même s'il y a des dates avant, colorer A3 de vert fluo.
code à améliorer... :
		VB:
	
	
	Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
ActiveWorkbook.ResetColors
If Not Intersect(Target, Range("B:B")) Is Nothing Then
    Cells(Target.Row, 2) = Date
    Cells(Target.Row, 1).Interior.ColorIndex = 6 'jaune
    If Cells(Target.Row, 3) <> "" Then
        Cells(Target.Row, 1).Interior.ColorIndex = 4 'vert
    End If
End If
If Not Intersect(Target, Range("G:G")) Is Nothing Then
    Cells(Target.Row, 7) = Date
    Cells(Target.Row, 1).Interior.ColorIndex = 4 'vert
    End If
End If
End Sub
	Merci !
Pièces jointes
			
				Dernière édition: