Copier image d'un userform vers cellule

Résolu
Bonjour,

j'aimerais copier une image inséré dans un userform dans une cellule mais je ne sais pas comment ?

Merci,

4 réponses

  • Votes
  • Date
  • Date décroissante
  1. Merci, mais malgré votre aide je ne comprend pas plus comment sectionné l'image du userform et la coller dans une cellule
    1. voici une partie de mon code

      ww = mn & 5 & aw + 3

      Set b = VBA.UserForms.Add(ww)

      If b.Image1.Tag <> "" Then

      Workbooks("Formulaire.xlsm").Worksheets("ajdonne").Pictures.Insert(b.Image1.Tag).Select

      Selection.Top = Range("k1").Top
      Selection.Left = Range("k1").Left

      End If

      If b.Image2.Tag <> "" Then

      Workbooks("Formulaire.xlsm").Worksheets("ajdonne").Pictures.Insert(b.Image2.Tag).Select

      Selection.Top = Range("k25").Top
      Selection.Left = Range("k25").Left

      End If

      Private Sub CommandButton2_Click()

      (...)

      Me.Image1.Picture = LoadPicture(FichImg)

      Me.Image1.Tag = FichImg

      (...)

      end sub

      ww est le nom du userform existant (vérifié)
      1. Re,

        cette partie marche sans probleme

        Sub test()
        ww = "userform2"

        Set b = VBA.UserForms.Add(ww)

        If b.Image1.Tag <> "" Then

        Workbooks("Formulaire.xlsm").Worksheets("Accueil").Pictures.Insert(b.Image1.Tag).Select

        Selection.Top = Range("k1").Top
        Selection.Left = Range("k1").Left

        End If

        If b.Image2.Tag <> "" Then

        Workbooks("Formulaire.xlsm").Worksheets("ajdonne").Pictures.Insert(b.Image2.Tag).Select

        Selection.Top = Range("k25").Top
        Selection.Left = Range("k25").Left

        End If
        End Sub


        Veuillez detailler un peu plus ce qui ne va pas !!!!!!!!!!!!!!!!!!!!

        A+