Double clic en H colore A et B en vert, en I figé aujourd'hui en J...

anthoYS

XLDnaute Barbatruc
Bonjour, ;)


... colorer A et B en gris.

Sinon tout est dit dans le titre du topic...
Voyez le fichier joint.
Si vous cernez ma demande...
N'hésitez pas à me poser des questions si vous avez des doutes. :confused:


Merci par avance

++
 

Pièces jointes

  • 547.xlsx
    9.6 KB · Affichages: 22
Dernière édition:

Chris401

XLDnaute Accro
Re : Double clic en H colore A et B en vert, en I figé aujourd'hui en J...

Bonjour

Quelque chose du genre
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Application.Intersect(Target, Range("H:H")) Is Nothing Then
Target.Offset(0, -7).Interior.ColorIndex = 4
Target.Offset(0, -6).Interior.ColorIndex = 4
Cancel = True
End If
If Not Application.Intersect(Target, Range("I:I")) Is Nothing Then
Target = Date
Cancel = True
End If
If Not Application.Intersect(Target, Range("J:J")) Is Nothing Then
Target.Offset(0, -9).Interior.ColorIndex = 15
Target.Offset(0, -8).Interior.ColorIndex = 15
Cancel = True
End If
End Sub
Cordialement
Chris
 

anthoYS

XLDnaute Barbatruc
Re : Double clic en H colore A et B en vert, en I figé aujourd'hui en J...

Bonjour

Quelque chose du genre
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Application.Intersect(Target, Range("H:H")) Is Nothing Then
Target.Offset(0, -7).Interior.ColorIndex = 4
Target.Offset(0, -6).Interior.ColorIndex = 4
Cancel = True
End If
If Not Application.Intersect(Target, Range("I:I")) Is Nothing Then
Target = Date
Cancel = True
End If
If Not Application.Intersect(Target, Range("J:J")) Is Nothing Then
Target.Offset(0, -9).Interior.ColorIndex = 15
Target.Offset(0, -8).Interior.ColorIndex = 15
Cancel = True
End If
End Sub
Cordialement
Chris

Par contre, ça ne colore pas en gris et la date ne doit pas aller en I mais en J.


à+
 

Chris401

XLDnaute Accro
Re : Double clic en H colore A et B en vert, en I figé aujourd'hui en J...

Re

On peut interpréter ta demande de plusieurs façon
Essaye
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Application.Intersect(Target, Range("H:H")) Is Nothing Then
Target.Offset(0, -7).Interior.ColorIndex = 4
Target.Offset(0, -6).Interior.ColorIndex = 4
Cancel = True
End If
If Not Application.Intersect(Target, Range("I:I")) Is Nothing Then
Target.Offset(0, 1) = Date
Target.Offset(0, -8).Interior.ColorIndex = 15
Target.Offset(0, -7).Interior.ColorIndex = 15
Cancel = True
End If
End Sub
Chris
 

Discussions similaires

Statistiques des forums

Discussions
314 228
Messages
2 107 515
Membres
109 856
dernier inscrit
slideo03