Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Report of Margins and Worksheet Setup?

Hello!

Any code out there to loop through all the sheets in a workbook and
give a report (MsgBox, etc.) of how each sheet is setup (values of
left/right/top/bottom margins, top/bottom headers, center on page hor/
vert, adjust to x% or fit to x page by x page)?

My workbooks have many tabs and going through each and verifying this
is taking awhile.

Any help appreciated!

VR/

Lost
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 209
Default Report of Margins and Worksheet Setup?

'/=================================================/
' Sub Purpose: list pagesetup info for all worksheets
' in current workbook
'/=================================================/
'
Public Sub PageSetupData()
Dim i As Long
Dim wks As Worksheet

Sheets.Add

On Error Resume Next

Range("A1").Select

ActiveCell.Offset(0, 0).value = "WKS Name"
ActiveCell.Offset(0, 1).value = "Print Title Rows"
ActiveCell.Offset(0, 2).value = "Print Title Columns"
ActiveCell.Offset(0, 3).value = "Print Area"
ActiveCell.Offset(0, 4).value = "Left Header"
ActiveCell.Offset(0, 5).value = "Center Header"
ActiveCell.Offset(0, 6).value = "Right Header"
ActiveCell.Offset(0, 7).value = "Left Footer"
ActiveCell.Offset(0, 8).value = "Center Footer"
ActiveCell.Offset(0, 9).value = "Right Footer"
ActiveCell.Offset(0, 10).value = "Left Margin"
ActiveCell.Offset(0, 11).value = "Right Margin"
ActiveCell.Offset(0, 12).value = "Top Margin"
ActiveCell.Offset(0, 13).value = "Bottom Margin"
ActiveCell.Offset(0, 14).value = "Head Margin"
ActiveCell.Offset(0, 15).value = "Foot Margin"
ActiveCell.Offset(0, 16).value = "Print Headings"
ActiveCell.Offset(0, 17).value = "Print Gridlines"
ActiveCell.Offset(0, 18).value = "Print Comments"
ActiveCell.Offset(0, 19).value = "Print Quality"
ActiveCell.Offset(0, 20).value = "Center Horizontally"
ActiveCell.Offset(0, 21).value = "Center Vertically"
ActiveCell.Offset(0, 22).value = "Orientation"
ActiveCell.Offset(0, 23).value = "Draft"
ActiveCell.Offset(0, 24).value = "Paper Size"
ActiveCell.Offset(0, 25).value = "First Page Number"
ActiveCell.Offset(0, 26).value = "Order"
ActiveCell.Offset(0, 27).value = "Black and White"
ActiveCell.Offset(0, 28).value = "Zoom"
ActiveCell.Offset(0, 29).value = "Print Errors"

For Each wks In Worksheets
i = i + 1
ActiveCell.Offset(i, 0).value = wks.name
With wks.PageSetup
ActiveCell.Offset(i, 1).value = .PrintTitleRows
ActiveCell.Offset(i, 2).value = .PrintTitleColumns
ActiveCell.Offset(i, 3).value = .PrintArea
ActiveCell.Offset(i, 4).value = .LeftHeader
ActiveCell.Offset(i, 5).value = .CenterHeader
ActiveCell.Offset(i, 6).value = .RightHeader
ActiveCell.Offset(i, 7).value = .LeftFooter
ActiveCell.Offset(i, 8).value = .CenterFooter
ActiveCell.Offset(i, 9).value = .RightFooter
ActiveCell.Offset(i, 10).value = .LeftMargin
ActiveCell.Offset(i, 11).value = .RightMargin
ActiveCell.Offset(i, 12).value = .TopMargin
ActiveCell.Offset(i, 13).value = .BottomMargin
ActiveCell.Offset(i, 14).value = .HeaderMargin
ActiveCell.Offset(i, 15).value = .FooterMargin
ActiveCell.Offset(i, 16).value = .PrintHeadings
ActiveCell.Offset(i, 17).value = .PrintGridlines
ActiveCell.Offset(i, 18).value = .PrintComments
ActiveCell.Offset(i, 19).value = .PrintQuality
ActiveCell.Offset(i, 20).value = .CenterHorizontally
ActiveCell.Offset(i, 21).value = .CenterVertically
ActiveCell.Offset(i, 22).value = .Orientation
ActiveCell.Offset(i, 23).value = .Draft
ActiveCell.Offset(i, 24).value = .PaperSize
ActiveCell.Offset(i, 25).value = .FirstPageNumber
ActiveCell.Offset(i, 26).value = .Order
ActiveCell.Offset(i, 27).value = .BlackAndWhite
ActiveCell.Offset(i, 28).value = .Zoom
ActiveCell.Offset(i, 29).value = .PrintErrors
End With

Next wks

'format worksheet
Range("B2").Select
ActiveWindow.FreezePanes = True
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Columns("A:AD").Select
Columns("A:AD").EntireColumn.AutoFit
Range("B2").Select

exit_Sub:
On Error Resume Next
Exit Sub

err_Sub:
Debug.Print "Error: " & Err.Number & " - (" & _
Err.Description & _
") - Sub: PageSetupData - Module: " & _
"Mod_PageSetup_Wkst - " & Now()
GoTo exit_Sub

End Sub
'/=================================================/
--
Hope this helps.
If this post was helpfull, please remember to click on the ''''YES''''
button at the bottom of the screen.
Thanks,
Gary Brown


"Lostguy" wrote:

Hello!

Any code out there to loop through all the sheets in a workbook and
give a report (MsgBox, etc.) of how each sheet is setup (values of
left/right/top/bottom margins, top/bottom headers, center on page hor/
vert, adjust to x% or fit to x page by x page)?

My workbooks have many tabs and going through each and verifying this
is taking awhile.

Any help appreciated!

VR/

Lost

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 do I setup page and margins for ALL sheets in an EXCEL file AFTERWARDS? Claudia d'Amato Excel Discussion (Misc queries) 1 September 3rd 08 01:44 PM
Annual gifts received report setup Babe Setting up and Configuration of Excel 1 June 24th 08 02:15 AM
SETUP MARGINS QUESTION Martin ©¿©¬ @nohere.net Excel Discussion (Misc queries) 3 April 12th 08 11:41 AM
Report Manager or Hidden Setup Sheet? RC[_6_] Excel Programming 4 February 21st 05 05:09 PM
can you set the "Page Setup" margins etc. differently for each pag Tony Excel Worksheet Functions 4 February 2nd 05 01:15 PM


All times are GMT +1. The time now is 01:57 PM.

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

About Us

"It's about Microsoft Excel"