Copy image from a userform to a cell
Solved
Bob0876
Posted messages
41
Status
Member
-
f894009 Posted messages 17417 Registration date Status Member Last intervention -
f894009 Posted messages 17417 Registration date Status Member Last intervention -
Hello,
I’d like to copy an image inserted in a userform into a cell, but I don’t know how?
Thank you.
I’d like to copy an image inserted in a userform into a cell, but I don’t know how?
Thank you.
4 answers
Hello,
inspire yourself from this
https://forums.commentcamarche.net/forum/affich-2328371-excel-inserer-une-image-ds-la-cellule-active
inspire yourself from this
https://forums.commentcamarche.net/forum/affich-2328371-excel-inserer-une-image-ds-la-cellule-active
Thank you, but despite your help I still don’t understand how to cut out the image from the userform and paste it into a cell.
here is a part of my 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 is the name of the existing userform (verified)
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 is the name of the existing userform (verified)