老师:若要插入几列,原来插入图片的列变动了,需要改动哪个参数?
Sub 添加图片()
SC
For I = 3 To Range("A65536").End(3).Row
If Dir(ThisWorkbook.Path & "\图片\" & Cells(I, 1) & ".jpg") <> "" Then
Set MR = ActiveSheet.Range("M" & I)
With MR.AddComment
.Shape.Fill.UserPicture ThisWorkbook.Path & "\图片\" & Cells(I, 1) & ".jpg"
.Shape.Height = 200
.Shape.Width = 280
End With
With ActiveSheet.Pictures.Insert(ThisWorkbook.Path & "\图片\" & Cells(I, 1) & ".jpg").ShapeRange
.LockAspectRatio = msoFalse
.Top = MR.Top
.Left = MR.Left + 1
.Height = MR.Height
.Width = MR.Width - 1
End With
End If
Next
End Sub
Sub SC()
Range("M:M").ClearComments
For Each shp In ActiveSheet.Shapes
If shp.Type <> 8 Then shp.Delete
Next
End Sub