❶ 在EXCEL中怎麼用宏插入圖片
材料/工具:電腦、Excel2007
1、首先,打開Excel表格,點擊表格最左上邊office按鈕---excel選項 。
❷ excel怎樣批量在批註插入圖片
Subpztp()
OnErrorResumeNext
DimcAsRange,P$,i&,a$,b$,arr,w!
P="F:唐獅圖片唐獅圖片"
ForEachcInRange([c2],Cells(Rows.Count,3).End(3))
Withc
.ClearComments
.AddComment
.Comment.Shape.Fill.UserPictureP&.Value&".jpg"
a=get_file_dim(P&.Value&".jpg")
Fori=1ToLen(a)
IfMid(a,i,1)Like"[0-9x]"Then
b=b&Mid(a,i,1)
EndIf
Next
arr=Split(b,"x")
b=""
w=200'設置圖片寬度
.Comment.Shape.Width=w
.Comment.Shape.Height=Val(arr(1))/Val(arr(0))*w
EndWith
Next
EndSub
Functionget_file_dim(ByValfilepathAsString)
arr=[{161,162,163,164,31}]
Dimbrr(),sz,iAsByte
ReDimbrr(1ToUBound(arr))
SetObiFolder=CreateObject("shell.Application").Namespace(Left(filepath,InStrRev(filepath,"")))
Fori=1ToUBound(arr)
sz=ObiFolder.getdetailsof(ObiFolder.Items.Item(Right(filepath,Len(filepath)-InStrRev(filepath,""))),arr(i))
IfszLike"*[0-9]x[0-9]*"Then
get_file_dim=sz
ExitFor
EndIf
Nexti
EndFunction