단축키 하나로 셀에 크기맞춰서 쏙쏙 들어가는 메크로 만듬 ㅇㅇ

Attribute VB_Name = "Module1"

Option Explicit


Sub Insert_Picture()

    Dim Pic_Sel As Variant

    Dim Pic As Object

    Dim i As Integer

    

    Pic_Sel = Application.GetOpenFilename(filefilter:="Picture Files,*.jpg;*.bmp;*.tif;*.gif;*.png")

    i = 0

    

    If Pic_Sel = False Then Exit Sub

    

    Set Pic = ActiveSheet.Shapes.AddPicture(Filename:=Pic_Sel, linktofile:=False, Savewithdocument:=True, Left:=Selection.Left + i / 2, Top:=Selection.Top + i / 2, Width:=Selection.Width - i, Height:=Selection.Height - i)

    

    

End Sub