|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 lt0314 于 2016-5-11 11:10 编辑
准考证批量打印.rar
(180.77 KB, 下载次数: 804)
2003版的可以修改下
- Sub pic()
- Dim shp As Shape, Rg_zp As Range, ksh As String, sht As Worksheet, Ppath As String, oldrg As Range, rat As Double
- Set sht = Sheets("准考证")
- Ppath = ThisWorkbook.Path & ""
- For Each shp In sht.Shapes
- If shp.Name Like "ksh_*" Then shp.Delete
- Next
- On Error Resume Next
- Set Rg_zp = sht.Cells.Find(What:="照片", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, MatchByte:=False, SearchFormat:=False)
- Set oldrg = Rg_zp
- While Not Rg_zp Is Nothing
- ksh = Rg_zp.Offset(1, 1).Value
- With sht.Pictures.Insert(Ppath & ksh & ".jpg")
- .Name = "ksh_" & ksh
- .Top = Rg_zp.Top
- .Left = Rg_zp.Left
- rat = Rg_zp.Width / .Width
- .Width = .Width * rat
- .Height = .Height * rat
- End With
- Set Rg_zp = sht.Cells.FindNext(Rg_zp)
- If Rg_zp.Address = oldrg.Address Then Exit Sub
- Wend
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|