#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 42
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 42
Default 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

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
Macros: can you copy macros from one doc to another? Roady Excel Discussion (Misc queries) 1 June 12th 08 05:47 PM
Excel 2007 macros - how to merge 5 macros together into one Sue Excel Discussion (Misc queries) 1 April 16th 08 08:36 PM
Macros warning always shows up, even if all macros removed Joe M Excel Discussion (Misc queries) 1 December 20th 07 04:45 AM
Macros - copying macros from one computer to another TT Excel Discussion (Misc queries) 18 December 14th 06 03:24 AM
Training: More on how to use macros in Excel: Recording Macros ToriT Excel Worksheet Functions 2 February 10th 06 07:05 PM


All times are GMT +1. The time now is 12:40 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"