Private Sub CommandButton1_Click()
Dim I As Long, J As Long
Dim Ar, Br
Dim S As String
If OptionButton1.Value = True Then
For I = 3 To Sheets.Count
Sheets(I).PrintOut
Next
Else
S = TextBox1.Text
If InStr(S, ",") = 0 Then
Sheets(Val(S) + 2).PrintOut
Else
Ar = Split(S, ",")
For I = 0 To UBound(Ar)
If InStr(Ar(I), "-") = 0 Then
Sheets(Val(Ar(I)) + 2).PrintOut
Else
Br = Split(Ar(I), "-")
For J = Br(0) To Br(1)
Sheets(J + 2).PrintOut
Next
End If
Next
End If
End If
End Sub
Private Sub CommandButton2_Click()
End
End Sub
窗体标题,你点下窗体空白的地方,然后左边属性里面找到 caption 就可以了,跟其他控件一样的。
文件----打印----打印内容“勾选整个工作簿”----确定。 就可以打印所有的SHEET了。
按住CTRL键,点SHEET1、SHEET3、SHEET5、SHEET8......点“文件”----打印----打印内容“勾选选定工作表”----确定。就只打印这几张表了。