|
| 问一个关于excel打印方面的问题? |
| 新闻出处:21ic
发布时间: 2007-07-04 |
moyifeng 发布于 2007-7-4 17:10:00 我做了一个标签,代码是这样的 Private Sub CommandButton1_Click() Dim Plus As Integer Dim Begin As Integer Dim X As String Dim Y As String Trans Plus = TextBox10.Text Begin = TextBox9.Text If UserForm1.Frame1.Caption = "HSM" Or UserForm1.Frame1.Caption = "SDV" Or UserForm1.Frame1.Caption = "SJC" Then Sheet1.Label17.Caption = Begin Sheet1.Label35.Caption = Begin + Plus If UserForm1.Frame1.Caption = "HSM" Then Sheet1.Label18.Caption = "HSM" Sheet1.Label36.Caption = "HSM" ElseIf UserForm1.Frame1.Caption = "SDV" Then Sheet1.Label18.Caption = "SDV" Sheet1.Label36.Caption = "SDV" ElseIf UserForm1.Frame1.Caption = "SJC" Then Sheet1.Label18.Caption = "SJC" Sheet1.Label36.Caption = "SJC" End If If vbYes = MsgBox("是否打印?", vbYesNo, "打印提示") Then '提示用户确定打印 'dlg.ShowPrinter For i = 0 To Trim(TextBox8.Text) / 2 - 1 Sheet1.PrintOut X = Sheet1.Label35.Caption Sheet1.Label17.Caption = X + Plus Y = Sheet1.Label17.Caption Sheet1.Label35.Caption = Y + Plus Next i ElseIf Frame1.Caption = "STT" Then Sheet4.Label16.Caption = Begin Sheet4.Label8.Caption = Begin + Plus For i = 0 To Trim(TextBox8.Text) / 2 - 1 Sheet4.PrintOut X = Sheet4.Label8.Caption Sheet4.Label16.Caption = X + Plus Y = Sheet4.Label16.Caption Sheet4.Label8.Caption = Y + Plus Next i ElseIf Frame1.Caption = "SKD" Then Sheet5.Label3.Caption = Begin Sheet5.Label7.Caption = Begin + Plus For i = 0 To Trim(TextBox8.Text) / 2 - 1 Sheet5.PrintOut X = Sheet5.Label7.Caption Sheet5.Label3.Caption = X + Plus Y = Sheet5.Label3.Caption Sheet5.Label7.Caption = Y + Plus Next i End If End If End Sub 要想打印出来的效果是这样的 Sheet4.Label16.Caption Sheet4.Label8.Caption 每打印一次递增一次. 但是打印的结果确是 Sheet4.Label16.Caption Sheet4.Label8.Caption 两个的值不变,请高手指教
|
| 【关闭】 【打印】 |
|
|
|
|