Рет қаралды 13,197
안녕하세요 먹돌이입니다. 아래 코드를 VBA에 복사 붙여넣기 해주세요~
Sub ImportPictureFile()
Dim strFile As String
Dim sht As Worksheet
Dim rngInsert As Range
Set sht = ActiveSheet
strFile = Application.GetOpenFilename(filefilter:="모든파일(*.*),*.*", _
Title:="삽입할 그림을 선택하세요//BEST & FIRST !!")
If strFile = "False" Then
MsgBox "아무 그림도 선택되지 않았습니다", , "BEST PARTNER! FIRST COMPANY!"
Exit Sub
End If
Set rngInsert = Selection
sht.Shapes.AddPicture Filename:=strFile, _
LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, _
Left:=rngInsert.Left + 5, _
Top:=rngInsert.Top + 5, _
Width:=rngInsert.Width - 10, _
Height:=rngInsert.Height - 10
End Sub