|
楼主 |
发表于 2013-3-26 11:13
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
帮忙看看代码哪出错了?运行到“ActiveSheet.Pictures.Insert(ThisWorkbook.Path & "\" & zhenhao & "FR.jpg").Select”时中止。
Sub 批量填充客户3项照片()
' 宏由 jiang_619 录制,时间: 2013-3-26
'
Dim i As Integer
Dim fr As Integer
Dim mm As Integer
Dim gt As Integer
Dim zhenhao As Integer
For i = 1 To 300
zhenhao = i * 15 - 11
fr = i * 15 - 12
mm = i * 15 - 12
gt = i * 15 - 6
Range("t" & fr).Select
ActiveSheet.Pictures.Insert(ThisWorkbook.Path & "\" & zhenhao & "FR.jpg").Select
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 147
Selection.ShapeRange.Width = 88
Selection.ShapeRange.Rotation = 0#
Selection.ShapeRange.ScaleWidth 0.73, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.73, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.24, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 2.5, msoFalse, msoScaleFromTopLeft
Range("y" & mm).Select
ActiveSheet.Pictures.Insert(ThisWorkbook.Path & "\" & zhenhao & "MM.jpg").Select
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 294
Selection.ShapeRange.Width = 440
Selection.ShapeRange.Rotation = 0#
Selection.ShapeRange.ScaleWidth 0.73, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.73, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.24, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 2.5, msoFalse, msoScaleFromTopLeft
Range("y" & gt).Select
ActiveSheet.Pictures.Insert(ThisWorkbook.Path & "\" & zhenhao & "GT.jpg").Select
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 294
Selection.ShapeRange.Width = 440
Selection.ShapeRange.Rotation = 0#
Selection.ShapeRange.ScaleWidth 0.73, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.73, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.24, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 2.5, msoFalse, msoScaleFromTopLeft
Next i
End Sub |
|