Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Stephen S
 
Posts: n/a
Default Page break in normal view set at startup

Excel 2003. Is it possible to have Excel with Tool/Options/View/Page Break
always set at startup.
  #2   Report Post  
HiArt
 
Posts: n/a
Default


Hi Stephen,

try adding the following VBA code to the workbook


Code:
--------------------
Sub Auto_Open()
ActiveSheet.DisplayAutomaticPageBreaks = True
End Sub

--------------------


HTH

Art


--
HiArt
------------------------------------------------------------------------
HiArt's Profile: http://www.excelforum.com/member.php...o&userid=19953
View this thread: http://www.excelforum.com/showthread...hreadid=402065

  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

Do you mean for a particular workbook or for all workbooks?

If you mean a particular workbook, you could use a macro like:

Option Explicit
Sub auto_open()

Dim wks As Worksheet
Dim ActCell As Range

Set ActCell = ActiveCell

For Each wks In ThisWorkbook.Worksheets
wks.Select
ActiveWindow.View = xlPageBreakPreview
Next wks

Application.Goto ActCell
End Sub



======

If you mean everytime you open a workbook (or create a new workbook????), you
could tie into an application event.

Start a new workbook
paste the code into the ThisWorkbook Module
Back to excel and File|SaveAs
Save it to a nice location, but as an Addin (use that dropdown at the bottom of
the file|saveas dialog).

Close excel
reopen excel
tools|addins|Browse for that addin you just created.

You can always disable/re-enable it via the tools|addins menu.

The code under 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)
Call DoTheWork(wb)
End Sub
Private Sub xlApp_WorkbookOpen(ByVal wb As Workbook)
Call DoTheWork(wb)
End Sub
Sub DoTheWork(wb As Workbook)

Dim wks As Worksheet
Dim ActCell As Range

Set ActCell = ActiveCell

For Each wks In wb.Worksheets
wks.Select
ActiveWindow.View = xlPageBreakPreview
Next wks

Application.Goto ActCell
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

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


Stephen S wrote:

Excel 2003. Is it possible to have Excel with Tool/Options/View/Page Break
always set at startup.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
SAHAJA
 
Posts: n/a
Default Page break in normal view set at startup


Do you think I could get a copy of your laser quoting file.


--
SAHAJA
------------------------------------------------------------------------
SAHAJA's Profile: http://www.excelforum.com/member.php...o&userid=33517
View this thread: http://www.excelforum.com/showthread...hreadid=402065

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
Page break problems Helen Excel Worksheet Functions 1 August 2nd 05 03:55 PM
How do I delete the page watermark in the page break preview? fragilemouse Excel Discussion (Misc queries) 2 May 19th 05 03:16 PM
printing - creating new files on each page break Tere Gardner Excel Worksheet Functions 4 May 4th 05 09:12 PM
Page view vs. Print View Mark G New Users to Excel 1 March 24th 05 08:43 AM
Page Break View - not the usual question Rose Excel Discussion (Misc queries) 0 March 2nd 05 04:25 PM


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

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"