Sub smdy()
On Error Resume Next
x = ExecuteExcel4Macro("get.document(50)")
For i = 1 To Int(x / 2) + 1
ExecuteExcel4Macro "PRINT(2," & 2 * i - 1 & "," & 2 * i - 1 & ",1,,,,,,,,2,,,TRUE,,FALSE)"
Next i
MsgBox "请将打印纸反向装入打印机中", vbOKOnly, "打印另一面"
For j = 1 To Int(x / 2) + 1
ExecuteExcel4Macro "PRINT(2," & 2 * j & "," & 2 * j & ",1,,,,,,,,2,,,TRUE,,FALSE)"
Next j
End Sub
全部回复(6 )
只看楼主 我来说两句Sub smdy()
On Error Resume Next
x = ExecuteExcel4Macro("get.document(50)")
For i = 1 To Int(x / 2) + 1
ExecuteExcel4Macro "PRINT(2," & 2 * i - 1 & "," & 2 * i - 1 & ",1,,,,,,,,2,,,TRUE,,FALSE)"
Next i
MsgBox "请将打印纸反向装入打印机中", vbOKOnly, "打印另一面"
For j = 1 To Int(x / 2) + 1
ExecuteExcel4Macro "PRINT(2," & 2 * j & "," & 2 * j & ",1,,,,,,,,2,,,TRUE,,FALSE)"
Next j
End Sub
输入完成后,关闭VBA编辑窗口返回到Excel编辑状态。
回复 举报
单击“开发工具”选项卡上的“Visual Basic”按钮,进入VBA编辑状态(如图4)。
特别提醒:按“Alt+F11”组合键,即可快速进入VBA编辑状态。
回复 举报