본문 바로가기
개발자 커뮤니티에 오신 것을 환영합니다!

vba [vba] 선택한 셀에 선택한 이미지 삽입

페이지 정보

profile_image
작성자 하나를하더라도최선을
댓글 0건 조회 36,285회 작성일 20-02-15 22:55

본문

Sub insert_Pic()
    Dim Pic   As Variant
    Pic = Application.GetOpenFilename(filefilter:="Picture Files,*.jpg;*.bmp;*.tif;*.gif;*.png")
    If Pic = False Then Exit Sub
     With ActiveSheet.Pictures.Insert(Pic).ShapeRange
        .LockAspectRatio = msoFalse
        .Height = Selection.Height - 4
        .Width = Selection.Width - 4
        .Left = Selection.Left + 2
        .Top = Selection.Top + 2
    End With
End Sub

댓글목록

등록된 댓글이 없습니다.


Copyright © program1472 | IT HUB. All rights reserved.