|
发表于 2014-4-13 18:50
|
显示全部楼层
本楼为最佳答案
- Sub 批量打印人员信息表()
- Dim rng As Range, c As Range, h&
- On Error Resume Next
- Set rng = Application.InputBox("请选择需要打印的人员" & vbCrLf & vbCrLf & "可按CTRL键选择不连续的人员", "提示", , Type:=8)
- If rng Is Nothing Then Exit Sub
- If MsgBox("将有" & rng.Count & "条数据被打印,请确定是否打印!", vbYesNo + vbInformation, "系统提示") = vbNo Then Exit Sub
- With Sheets("Template")
- For Each c In rng
- h = c.Row
- .Shapes("TXTc").DrawingObject.Caption = Cells(h, "e")
- '其他类推
- .[a1:h25].PrintOut
- Next
- End With
- MsgBox "操作完毕!", vbInformation + vbOKOnly, "提示"
- End Sub
复制代码 |
|