XL 2010 [Résolu] Filigrane sous conditions

alias_2003

XLDnaute Occasionnel
Bonjour,
Est-il possible d'ajouter une image en filigrane et ce, sous conditions ?
Par ex., dans le fichier joint, si la cellule A1 contient le mot Fleur, mettre la photo en filigrane, sinon la masquer.
Merci mille fois de votre aide,
Amicalement
 

Pièces jointes

  • Classeur1.xlsm
    155.2 KB · Affichages: 74

job75

XLDnaute Barbatruc
Bonjour alias_2003, sousou, le forum,

Fichier joint avec cette macro :
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [A1]) Is Nothing Then Exit Sub
If LCase([A1]) <> "fleur" Then Me.SetBackgroundPicture "": Exit Sub
Dim fichier As String
fichier = ThisWorkbook.Path & "\Image.jpg"
'---création du fichier JPEG---
With Feuil2.Pictures("Image 1") 'CodeName de la feuille
  .CopyPicture
  With .Parent.ChartObjects.Add(0, 0, .Width, .Height).Chart
    .Paste
    .Export fichier, "JPG"
    .Parent.Delete
  End With
End With
Me.SetBackgroundPicture fichier
Kill fichier
End Sub
Bonne journée.
 

Pièces jointes

  • Image de fond(1).xlsm
    168.6 KB · Affichages: 60

Discussions similaires

Statistiques des forums

Discussions
312 329
Messages
2 087 334
Membres
103 519
dernier inscrit
Thomas_grc11