PC Review


Reply
Thread Tools Rate Thread

combind print copy amount

 
 
=?Utf-8?B?Q3VydA==?=
Guest
Posts: n/a
 
      30th Sep 2007
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" & 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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?QW5hbnQgQmFzYW50?=
Guest
Posts: n/a
 
      1st Oct 2007
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.
--
Regards,
Anant


"Curt" wrote:

> 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" & 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
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
combind and rename Pierre Microsoft Access Queries 2 21st Apr 2008 07:30 PM
how to limt Copy amount Lothar Belle Microsoft Windows 2000 Networking 1 14th Aug 2007 02:00 PM
How to combind to cell with a <space> =?Utf-8?B?Um9nZXI=?= Microsoft Excel Worksheet Functions 1 27th Feb 2007 11:14 PM
hot to copy large amount of data from one mdb 2 another John Smith Microsoft Access 2 24th Jun 2004 07:20 AM
How do you copy & paste the subtotal amount only? jmaxwell@max-auto.com Microsoft Excel Setup 1 3rd Dec 2003 03:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:23 PM.