ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Macros (https://www.excelbanter.com/excel-worksheet-functions/226405-macros.html)

Lois

Macros
 
I have recorded the following macro to select sheets of a workbook as a group
& view them in print preview, then return to normal view (this is the my boss
wanted to view them), is there any way to 'generalise' it so it can be used
in any workbook i.e. without listing tab names. also, his screen is quite
big but the document doesnt fill it in print preview, is there any way i can
get the document to fill the screen in print preview?

Sub Ken_Full_Screen_View()
'
' Ken_View Macro
' Macro recorded 01/04/2009 by lois
'

'
ActiveWindow.Zoom = 400
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets(Array("Cover Sheet", "FAULTS BY Nº", "FAULTS BY COST", "Summary",
"No 1", _
"No 2", "No 3", "No 4", "No 5", "No 6", "No 7", "No 8")).Select
Sheets("Cover Sheet").Activate
ActiveWindow.SelectedSheets.PrintPreview
End Sub

Sub Ken_Normal_View()
'
' Ken_Normal_View Macro
' Macro recorded 01/04/2009 by lois
'

'
Sheets("Cover Sheet").Select
ActiveWindow.Zoom = 100
End Sub
--
Lois

Jacob Skaria

Macros
 
The below will work for all workbooks. Active window Zoom will only zoom the
worksheet not the print preview screen.

Sub ViewAllSheets_PrintPreview()
ActiveWorkbook.Sheets.Select
ActiveWindow.SelectedSheets.PrintPreview
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Lois" wrote:

I have recorded the following macro to select sheets of a workbook as a group
& view them in print preview, then return to normal view (this is the my boss
wanted to view them), is there any way to 'generalise' it so it can be used
in any workbook i.e. without listing tab names. also, his screen is quite
big but the document doesnt fill it in print preview, is there any way i can
get the document to fill the screen in print preview?

Sub Ken_Full_Screen_View()
'
' Ken_View Macro
' Macro recorded 01/04/2009 by lois
'

'
ActiveWindow.Zoom = 400
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets(Array("Cover Sheet", "FAULTS BY Nº", "FAULTS BY COST", "Summary",
"No 1", _
"No 2", "No 3", "No 4", "No 5", "No 6", "No 7", "No 8")).Select
Sheets("Cover Sheet").Activate
ActiveWindow.SelectedSheets.PrintPreview
End Sub

Sub Ken_Normal_View()
'
' Ken_Normal_View Macro
' Macro recorded 01/04/2009 by lois
'

'
Sheets("Cover Sheet").Select
ActiveWindow.Zoom = 100
End Sub
--
Lois


Lois

Macros
 
Hi,
I have just tried the macro below, but it doesnt seem to like the
'ActiveWorkbook.Sheets.Select' bit!?
--
Lois


"Jacob Skaria" wrote:

The below will work for all workbooks. Active window Zoom will only zoom the
worksheet not the print preview screen.

Sub ViewAllSheets_PrintPreview()
ActiveWorkbook.Sheets.Select
ActiveWindow.SelectedSheets.PrintPreview
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Lois" wrote:

I have recorded the following macro to select sheets of a workbook as a group
& view them in print preview, then return to normal view (this is the my boss
wanted to view them), is there any way to 'generalise' it so it can be used
in any workbook i.e. without listing tab names. also, his screen is quite
big but the document doesnt fill it in print preview, is there any way i can
get the document to fill the screen in print preview?

Sub Ken_Full_Screen_View()
'
' Ken_View Macro
' Macro recorded 01/04/2009 by lois
'

'
ActiveWindow.Zoom = 400
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets(Array("Cover Sheet", "FAULTS BY Nº", "FAULTS BY COST", "Summary",
"No 1", _
"No 2", "No 3", "No 4", "No 5", "No 6", "No 7", "No 8")).Select
Sheets("Cover Sheet").Activate
ActiveWindow.SelectedSheets.PrintPreview
End Sub

Sub Ken_Normal_View()
'
' Ken_Normal_View Macro
' Macro recorded 01/04/2009 by lois
'

'
Sheets("Cover Sheet").Select
ActiveWindow.Zoom = 100
End Sub
--
Lois



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

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