|
发表于 2014-1-22 18:17
|
显示全部楼层
本楼为最佳答案
本帖最后由 suye1010 于 2014-1-23 11:30 编辑
Private Sub CommandButton1_Click()
Dim a As String
Dim b As String
Dim ks
Dim js
Dim tm As String
ks = InputBox("请输入起始编号:"): If Len(ks) = 0 Then Exit Sub
js = InputBox("请输入截止编号"): If Len(js) = 0 Then Exit Sub
C = InputBox("你要打印几份?"): If Len(C) = 0 Then Exit Sub
a = Sheets("打印编号").Range("b:b").Find(ks).Row
b = Sheets("打印编号").Range("b:b").Find(js).Row
If a <> b And a <> "" And b <> "" Then
For counter = a To b
tm = Sheets("打印编号").Cells(counter, 1)
For Each shp In ActiveSheet.Shapes
If shp.Type = 13 Then
shp.Delete
End If
Next
ActiveSheet.Shapes.AddPicture ThisWorkbook.Path & "\照片\" & tm & ".bmp", True, True, 550, 25, 175, 60
ThisWorkbook.Save
Range("o5") = counter
ActiveSheet.PrintOut Copies:=C, Collate:=True
DoEvents
Next counter
End If
Sheets("套打").Range("o5") = "=MATCH(o6,打印编号!b:b,)"
End Sub
打印.zip
(898.03 KB, 下载次数: 5)
|
评分
-
查看全部评分
|