ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   printing selected sheets (https://www.excelbanter.com/excel-programming/363547-printing-selected-sheets.html)

funkymonkUK[_179_]

printing selected sheets
 

Hi

I have a workbook say with worksheets names from Sheet1 to sheet6. no
those exact names but just as an example.

what I want to do is select sheet1 to sheet5 and print. i thought mayb
something along the lines of

Sheet(1 - (sheets.count -1)).select
selection.print

but it doesn't seem to work

--
funkymonkU
-----------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...fo&userid=1813
View this thread: http://www.excelforum.com/showthread.php?threadid=54942


Giles B[_2_]

printing selected sheets
 
Funky,

Try something like this:

Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", _
"Sheet5")).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

Rgrds

Giles

"funkymonkUK" wrote:


Hi

I have a workbook say with worksheets names from Sheet1 to sheet6. not
those exact names but just as an example.

what I want to do is select sheet1 to sheet5 and print. i thought maybe
something along the lines of

Sheet(1 - (sheets.count -1)).select
selection.print

but it doesn't seem to work.


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=549426



funkymonkUK[_180_]

printing selected sheets
 

this would work with my example. but i have a workbook with 46+ tabs
each with different names is there not something equilivant to
range("A1:b2") but for sheets?


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=549426


Giles B[_2_]

printing selected sheets
 
Funky,

I did it by recording a macro - selecting the sheet tabs using the Shift and
Control keys. This does all the names bit for you (lazy!)

I guess you could do something along the lines of:

Option Explicit
Sub PrintList()

Dim ws As Worksheet

For Each ws In ActiveWorkbook.Sheets
Application.StatusBar = "Printing " & ws.Name
if ws.name < "Sheet2" then ws.PrintOut
Next

End Sub

which will print all sheets except sheet2

or if you just want to print them all -

sheets.printout does that for you.


"funkymonkUK" wrote:


Hi

I have a workbook say with worksheets names from Sheet1 to sheet6. not
those exact names but just as an example.

what I want to do is select sheet1 to sheet5 and print. i thought maybe
something along the lines of

Sheet(1 - (sheets.count -1)).select
selection.print

but it doesn't seem to work.


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=549426



Ron de Bruin

printing selected sheets
 
There are a few one liners here
http://www.rondebruin.nl/print.htm#Print

--
Regards Ron De Bruin
http://www.rondebruin.nl



"funkymonkUK" wrote in message
...

Hi

I have a workbook say with worksheets names from Sheet1 to sheet6. not
those exact names but just as an example.

what I want to do is select sheet1 to sheet5 and print. i thought maybe
something along the lines of

Sheet(1 - (sheets.count -1)).select
selection.print

but it doesn't seem to work.


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=549426





All times are GMT +1. The time now is 03:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com