Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2006

Tip: Looking for answers? Try searching our database.

xlb default

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JAVB - 09 Jan 2006 13:28 GMT
Is there a way to change the default for the Tools|options|view|Pag
breaks to have the page breaks show on all sheets on all workbooks?  
have tried changing a xlt workbook buy going into every sheet an
checking the box to show the page breaks and saving it.  When I open
new workbook from the template it does not show the page breaks.
Opening the xlb does not give the option to change it.

JAV
Dave Peterson - 09 Jan 2006 14:51 GMT
Saved from a previous post:

Using the pagebreak view of a newly created workbook doesn't make a lot of sense
to me.

Try it to see what it does.  I wouldn't use it.

But this will do what you ask (both opening existing workbooks and creating new
workbooks).

Start a new workbook
copy this code into the ThisWorkbook module.

Option Explicit
Public WithEvents xlApp As Excel.Application
Private Sub Workbook_Open()
   Set xlApp = Application
End Sub
Private Sub Workbook_Close()
   Set xlApp = Nothing
End Sub
Private Sub xlApp_NewWorkbook(ByVal Wb As Workbook)
   Dim myWindow As Window
   For Each myWindow In Wb.Windows
       myWindow.View = xlPageBreakPreview
   Next myWindow
End Sub
Private Sub xlApp_WorkbookOpen(ByVal Wb As Workbook)
   Dim myWindow As Window
   For Each myWindow In Wb.Windows
       myWindow.View = xlPageBreakPreview
   Next myWindow
End Sub

Now save this workbook in your XLStart folder.

Then close excel and restart excel.

If you don't want the new workbook to be affected, just delete this portion:

Private Sub xlApp_NewWorkbook(ByVal Wb As Workbook)
   Dim myWindow As Window
   For Each myWindow In Wb.Windows
       myWindow.View = xlPageBreakPreview
   Next myWindow
End Sub

========

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

And you can read a lot more about application events at Chip Pearson's site:
http://www.cpearson.com/excel/AppEvent.htm

> Is there a way to change the default for the Tools|options|view|Page
> breaks to have the page breaks show on all sheets on all workbooks?  I
[quoted text clipped - 10 lines]
> JAVB's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=29304
> View this thread: http://www.excelforum.com/showthread.php?threadid=499359

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.