+ Reply to Thread
Results 1 to 4 of 4

Page break in normal view set at startup

  1. #1
    Stephen S
    Guest

    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. #2
    Forum Contributor
    Join Date
    02-15-2005
    Location
    Blackpool, UK
    Posts
    137
    Hi Stephen,

    try adding the following VBA code to the workbook

    Please Login or Register  to view this content.
    HTH

    Art

  3. #3
    Dave Peterson
    Guest

    Re: Page break in normal view set at startup

    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. #4
    Registered User
    Join Date
    04-14-2006
    Posts
    1

    Just hoping

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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1