centrino34
XLDnaute Nouveau
Bonjour voila le code que j'utilise pour afficher des images (fonctionne très bien), cependant j'aimerais pouvoir modifier la ligne If Target.Column = 10 And Target.Count = 1 Then en donnant comme référence une autre feuille du classeur et une autre cellule de référence pour afficher mes images.
est il possible de le faire?
Merci d'avance de votre aide
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 10 And Target.Count = 1 Then
'-- suppression
For Each s In ActiveSheet.Shapes
If s.Type = 13 Then
If s.TopLeftCell.Address = Target.Offset(0, 1).Address Then
s.Delete
End If
End If
Next s
'--
If Target <> "" Then
On Error GoTo Pas_Image
Sheets("Images").Shapes(Target).Copy
On Error GoTo 0
Target.Offset(0, 1).Select
ActiveSheet.Paste
Selection.ShapeRange.Left = ActiveCell.Left + 9
Selection.ShapeRange.Top = ActiveCell.Top + 32
Target.Select
End If
End If
Pas_Image:
If Error = "L'élément portant ce nom est introuvable." Then Exit Sub
End Sub
est il possible de le faire?
Merci d'avance de votre aide
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 10 And Target.Count = 1 Then
'-- suppression
For Each s In ActiveSheet.Shapes
If s.Type = 13 Then
If s.TopLeftCell.Address = Target.Offset(0, 1).Address Then
s.Delete
End If
End If
Next s
'--
If Target <> "" Then
On Error GoTo Pas_Image
Sheets("Images").Shapes(Target).Copy
On Error GoTo 0
Target.Offset(0, 1).Select
ActiveSheet.Paste
Selection.ShapeRange.Left = ActiveCell.Left + 9
Selection.ShapeRange.Top = ActiveCell.Top + 32
Target.Select
End If
End If
Pas_Image:
If Error = "L'élément portant ce nom est introuvable." Then Exit Sub
End Sub