1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Private Sub Worksheet_Change(ByVal Target As Range)
Dim typ As String
Dim c As Range
If Not Intersect(Target, Range("H2:H3")) Is Nothing Then
If Range("H2").Value <> "" And Range("H3").Value <> "" Then
typ = "Total " & Range("H3").Value
On Error Resume Next
Set c = Sheets("" & Range("H2").Value & "").Columns("A:A").Find(typ, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
Range("H6").Value = c.Offset(0, 2).Value
Range("H7").Value = c.Offset(0, 3).Value
Else
Range("H6:H7").ClearContents
MsgBox "designation inéxistante"
End If
Set c = Nothing
End If
End If
End Sub |
Partager