Copier image d'un userform vers cellule

Résolu
Bob0876 Messages postés 41 Statut Membre -  
f894009 Messages postés 17417 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,

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

Merci,

4 réponses

  1. Bob0876 Messages postés 41 Statut Membre
     
    Merci, mais malgré votre aide je ne comprend pas plus comment sectionné l'image du userform et la coller dans une cellule
    0
  2. Bob0876 Messages postés 41 Statut Membre
     
    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é)
    0
  3. f894009 Messages postés 17417 Date d'inscription   Statut Membre Dernière intervention   1 717
     
    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+
    0