insert picture in cell

  • hello everyone,
    i have a problem, with a button(insert) i want to get file name, and with an other button( load) i want to load this picture with its path that i have already got to load it in a specific cell
    [VBA]



    Private Sub CommandButton3_Click()


    Dim pct As Picture, image As String
    image = Application.GetOpenFilename()
    Me.Image1.Picture = LoadPicture(image)
    Me.Image1.Visible = True
    Image1.PictureSizeMode = 1


    End Sub




    Private Sub CommandButton1_Click()


    Dim derligne As Integer
    Dim L As Single, T As Single, W As Single, H As Single
    If MsgBox("confirmez-vous l'ajout de vos données?", vbYesNo, "confirmation") = vbYes Then
    derligne = Sheets("capitaliser").Range("A456541").End(xlUp).Row + 1
    '**********************************************************************************ajout de l'image dans cellule 10************************************************************************************************************
    Set pct = ActiveSheet.Pictures.Insert(image)
    pct.ShapeRange.Left = Cells(derligne, 10).Left
    pct.ShapeRange.Top = Cells(derligne, 10).Top
    pct.ShapeRange.Width = Cells(derligne, 10).Width
    pct.ShapeRange.Height = Cells(derligne, 10).Height


    [/VBA]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!