Private Sub Worksheet_Change(ByVal Target As Range)
Dim searchFolder As String, fileName As String
Static PowerPointApp As Object
If Target.Column = 2 Then
If Target.CountLarge > 1 Then Exit Sub
If Target.Value = "" Then Exit Sub
' Partie 1 ---------------------------------------------------------------------------------------------------------
searchFolder = "C:\Users\crolles300 oper\STMicroelectronics\C300 Lithography Module - Derogations STARLight"
If Right(searchFolder, 1) <> "\" Then searchFolder = searchFolder & "\"
fileName = Dir(searchFolder & "*" & Target.Value & "*.ppt*")
If fileName <> vbNullString Then
If MsgBox(fileName & " existe. Voulez-vous l'ouvrir ?", vbYesNo + vbQuestion, "Fiche de dérogation") = vbYes Then
If PowerPointApp Is Nothing Then Set PowerPointApp = CreateObject("PowerPoint.Application")
PowerPointApp.Presentations.Open searchFolder & fileName
End If
End If
' Partie 2 ---------------------------------------------------------------------------------------------------------
Dim Refcell As Range
Set Refcell = WorkSheets("Feuil2").cells({Ligne},{colonne}).value
If Target.Value = Refcell.Value Then
MsgBox "le contenu=" & Refcell.Offset(, 1).Value
End If
End If
End Sub