카테고리 없음
Excel - Macro
파란크리스마스
2017. 7. 23. 18:41
728x90
출처 : [엑셀] 매크로를 이용하여 지정한 크기의 셀 안에 사진 넣기 : 네이버 블로그
엑셀 메크로 그림(이미지)을 엑셀 파일에 직접 포함시키는 방법 - 달집의 팁 - 문하우스
이미지 삽입 - Excel 파일에 이미지 내장
Sub insert_Pic() Dim Pic As Variant Pic = Application.GetOpenFilename _ (filefilter:="Picture Files,*.jpg;*.bmp;*.tif;*.gif;*.png;*.jpeg") If Pic = False Then Exit Sub End If With ActiveSheet.Shapes.AddPicture(Pic, False, True, Selection.Left, Selection.Top, Selection.Width, Selection.Height) .LockAspectRatio = msoFalse End With End Sub
이미지 삽입 - Excel 파일에 이미지 경로만 저장
Sub ins_Pic() Dim myPic As Variant myPic = Application.GetOpenFilename _ (filefilter:="Picture Files,*.jpg;*.bmp;*.tif;*.gif") If myPic = False Then Exit Sub End If With ActiveSheet.Pictures.Insert(myPic).ShapeRange .LockAspectRatio = msoFalse .Height = Selection.Height .Width = Selection.Width .Left = Selection.Left .Top = Selection.Top End With End Sub
728x90