Cual macro para Insertar imagen

Dante Amor

Dan para insertar una imagen el userform como seria

1 respuesta

Respuesta
1

H o l a:

Te anexo la macro

Sub PonerFoto(h1, num)
'Por.Dante Amor
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    Image1.Picture = Nothing
    'num = 7
    ruta = ThisWorkbook.Path & "\"
    nombre = num & " Imagen"
    For Each sh In h1.Shapes
        If sh.Name = nombre Then
            Set h2 = Sheets.Add
            With h1.Shapes(nombre)
                .Copy
                ancho = .Width
                alto = .Height
            End With
            '
            h2.Shapes.AddChart
            h2.ChartObjects(1).Select
            With Selection
                .Width = ancho
                .Height = alto
                .Chart.Paste
                .Chart.Export ruta & "temporal.JPEG"
            End With
            h2.Delete
            Image1.Picture = LoadPicture(ruta & "temporal.JPEG")
            Exit For
        End If
    Next
    Application.ScreenUpdating = True
End Sub

S a l u d o s . D a n t e   A m o r

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas