ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printing certain pages within Active Sheets only (https://www.excelbanter.com/excel-programming/373126-printing-certain-pages-within-active-sheets-only.html)

gtslabs[_2_]

Printing certain pages within Active Sheets only
 
I have the following code to print certain page numbers for all the
sheets in my workbook.
Sub Print_All()
Dim sht As Variant
For Each sht In ThisWorkbook.Sheets
sht.PrintOut From:=1, To:=1, Copies:=1, Collate:=True
Next sht
End Sub

But how would I do the same for only the active or sheets selected with
my mouse?


The other problem I have is that there is not much difference in tab
color when I select sheets. Sometimes I make mistakes and type over in
other sheets because I could not tell that more than one was selected.
IS there a way to adjust the color of the tabs once they are selected?
I know I can change the tab colors but not sure if I can do that for
just selected tabs.


Tom Ogilvy

Printing certain pages within Active Sheets only
 
Sub Print_All()
Dim sht As Variant
For Each sht In ActiveWindow.SelectedSheets
sht.PrintOut From:=1, To:=1, Copies:=1, Collate:=True
Next sht
End Sub

--
Regards,
Tom Ogilvy


"gtslabs" wrote:

I have the following code to print certain page numbers for all the
sheets in my workbook.
Sub Print_All()
Dim sht As Variant
For Each sht In ThisWorkbook.Sheets
sht.PrintOut From:=1, To:=1, Copies:=1, Collate:=True
Next sht
End Sub

But how would I do the same for only the active or sheets selected with
my mouse?


The other problem I have is that there is not much difference in tab
color when I select sheets. Sometimes I make mistakes and type over in
other sheets because I could not tell that more than one was selected.
IS there a way to adjust the color of the tabs once they are selected?
I know I can change the tab colors but not sure if I can do that for
just selected tabs.




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

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