❶ 在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