1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range("F2:F2500"), Target) Is Nothing Then
ligne = ActiveCell.Row
If Left(Range("C" & ligne), 4) = "====" Then
Range("D" & ligne) = (Right(Range("C" & ligne), Len(Range("C" & ligne)) - (InStr(5, Range("C" & ligne), "====") + 3)))
Else
Range("D" & ligne) = (Range("C" & ligne))
End If
For Each col In Array(1, 2, 4, 5)
If Not Target.Offset(, col).Comment Is Nothing Then Target.Offset(, col).Comment.Delete
p = Application.Match(Target.Offset(, col), Application.Index([Dispo], , 1), 0)
If Not IsError(p) Then
temp = Sheets("Data").Range("Dispo").Cells(p, 2)
Target.Offset(, col).AddComment
Target.Offset(, col).Comment.Text Text:=temp
Target.Offset(, col).Comment.Shape.TextFrame.AutoSize = True
End If
Next col
End If
'---------------------------------------------------------------------------------------------------------------
'Ajoute une couleur aux serveurs rélatif à plusieurs applications
'---------------------------------------------------------------------------------------------------------------
If Not Intersect([Liste_Serveurs], Target) Is Nothing Then
On Error Resume Next
Target.Interior.ColorIndex = [couleurs].Find(Target, LookAt:=xlWhole).Interior.ColorIndex
End If
'---------------------------------------------------------------------------------------------------------------
' Ajoute la date et l'heure en colonne N
'---------------------------------------------------------------------------------------------------------------
DateFR = CDate(Format(Date, "mm" & Chr$(47) & "dd" & Chr$(47) & "yy"))
TimeFR = CDate(Format(Time, "hh" & Chr$(58) & "mm"))
'If Target.Column <> 2 Then Exit Sub
'If Target.Value <> "" And Cells(Target.Row, Target.Column + 13) = "" Then Cells(Target.Row, Target.Column + 13) = DateFR & " " & TimeFR
If Cells(Target.Row, 14) <> "" And Cells(Target.Row, 15) <> "" And Cells(Target.Row, 16) = "" Then Cells(Target.Row, 16) = DateFR & " " & TimeFR
End Sub |