combind print copy amount

G

Guest

is it possible to have this code apply to all sheets following. I have been
able to create the sheets easily now to print. I use the amount code on other
print applications. If these sheets need to be printed all will be needed
Sheets are by NBR 1-9. The enclosed code has print amount (') out.
Heres Hoping Thanks

Private Sub OptionButton36_Click()
'Worksheets("Layout").Select
'With Sheets("Layout")
'.pagesetup.PrintArea = "A1:D" & Cells(Rows.Count, "B").End(xlUp).Row
' pCnt = Application.InputBox("How Many Copies from 1-9", Type:=1)
' If pCnt < 1 Or pCnt > 9 Then Exit Sub
' ActiveWindow.SelectedSheets.PrintOut Copies:=pCnt, Collate:=True
' .pagesetup.PrintGridlines = True
'End With
' ActiveSheet.pagesetup.PrintArea = ""
'Range("E4").Select
Worksheets("1").Select
With Sheets("1")
..pagesetup.PrintArea = "a1:d" & Cells(Rows.Count, "b").End(xlUp).Row
..PrintOut
..pagesetup.PrintArea = ""
End With
Worksheets("2").Select
With Sheets("2")
..pagesetup.PrintArea = "a1:d" & Cells(Rows.Count, "b").End(xlUp).Row
..PrintOut
..pagesetup.PrintArea = ""
End With
Worksheets("3").Select
With Sheets("3")
..pagesetup.PrintArea = "a1:d" & Cells(Rows.Count, "b").End(xlUp).Row
..PrintOut
..pagesetup.PrintArea = ""
End With
Worksheets("4").Select
With Sheets("4")
..pagesetup.PrintArea = "a1:d" & Cells(Rows.Count, "b").End(xlUp).Row
..PrintOut
..pagesetup.PrintArea = ""
End With
Worksheets("5").Select
With Sheets("5")
..pagesetup.PrintArea = "a1:d" & Cells(Rows.Count, "b").End(xlUp).Row
..PrintOut
..pagesetup.PrintArea = ""
End With
Worksheets("6").Select
With Sheets("6")
..pagesetup.PrintArea = "a1:d" & Cells(Rows.Count, "b").End(xlUp).Row
..PrintOut
..pagesetup.PrintArea = ""
End With
Worksheets("7").Select
With Sheets("7")
..pagesetup.PrintArea = "a1:d" & Cells(Rows.Count, "b").End(xlUp).Row
..PrintOut
..pagesetup.PrintArea = ""
End With
Worksheets("8").Select
With Sheets("8")
..pagesetup.PrintArea = "a1:d" & Cells(Rows.Count, "b").End(xlUp).Row
..PrintOut
..pagesetup.PrintArea = ""
End With
Worksheets("9").Select
With Sheets("9")
..pagesetup.PrintArea = "a1:d" & Cells(Rows.Count, "b").End(xlUp).Row
..PrintOut
..pagesetup.PrintArea = ""
End With
Sheets("Data").Select
Range("A4").Select
End Sub
 
G

Guest

The following code applies to all the sheets in the workbook.

Private Sub OptionButton36_Click()
Dim shtCount As Integer
Dim i As Integer
shtCount = ActiveWorkbook.Sheets.Count
For i = 1 To shtCount
If TypeName(Sheets(i)) = "Worksheet" Then
With Sheets(i)
.PageSetup.PrintArea = "a1:d" & _
.Cells(.Rows.Count, "b").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
End With
End If
Next i
End Sub

Although the question that you have asked is not quite clear. Hope this code
helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top