Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default combind print copy amount

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default combind print copy amount

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: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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to combind to cell with a <space Roger Excel Worksheet Functions 1 February 27th 07 11:14 PM
How do I print formula figures and calculated amount in a cell? SLM Excel Discussion (Misc queries) 6 January 3rd 06 05:48 PM
Amount of Data in a Cell Displayed On Screen/Print James H Excel Discussion (Misc queries) 3 April 27th 05 06:47 PM
i want excel to read the amount (no. format-20,000.00) and print . Rajiv Madan Excel Programming 1 March 14th 05 08:49 AM
how to copy record only with amount from 1 sheet to another tango Excel Programming 1 October 22nd 04 12:02 PM


All times are GMT +1. The time now is 07:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"