|
- Sub Test()
- Dim SH As Worksheet
- Dim rgArea As Range, rg As Range, rg2 As Range
- Dim strFileName As String
- Dim sngLeft As Single, sngTop As Single
- Dim sngWidth As Single, sngHeight As Single
- Dim shPic As Shape
-
- Set SH = Sheets("Sheet1")
- Set rgArea = SH.Range("A2:A12")
-
- For Each rg In rgArea
- strFileName = rg.Text
- Set rg2 = rg.Offset(0, 1)
- sngLeft = rg2.Left
- sngTop = rg2.Top
- sngWidth = rg2.Width
- sngHeight = rg2.Height
-
- Set shPic = SH.Shapes.AddPicture(strFileName, msoFalse, msoTrue, sngLeft, sngTop, sngWidth, sngHeight)
- Next
- MsgBox "OK"
- End Sub
复制代码 |
评分
-
5
查看全部评分
-
|