图形对象(Shape)
图形对象常用属性
Sheet1.shapes.count
Shp.Type
Shp.Name
Shp.TopLeftCell.Address
Shp.Top
Shp.Left
Shp.Height
Shp.Width
Shp.Visible
操作图片(Picture)
图片对象常用方法和属性
Sheet1.Shapes.AddPicture
参数:善用帮助功能
Filename
LinkToFile
SaveWithDocument
Left
Top
Width
Height
使用Like语句
* 任意字符
# 任意数字
? 一位字符
! 逻辑非
[A-Z] 大写字母
[A-Z a-z] 字母
[0-9] 数字
[!A-Z] 非大写字母
[!0-9] 非数字
按位置插入并调整图片(靠帮助)
'插入照片
Sub test2()
Dim i As Integer
Dim shp As Shape
'防止报错
On Error Resume Next
'循坏遍历,删除对象
For Each shp In Sheet1.Shapes
shp.Delete
Next
'for循环到数据尾行
For i = 2 To Sheet1.UsedRange.Rows.Count
Sheet1.Shapes.AddPicture "D:\DATA\" & Range("a" & i) & ".jpg", msoFalse, msoTrue, Range("