+ Reply to Thread
Results 1 to 5 of 5

Macro Speed

  1. #1
    Don Lloyd
    Guest

    Macro Speed

    Hi,

    I have a worksheet with a list of approx. 1,000 rows and 16 columns.

    A macro is used to run some fairly complex code to arrange the list in
    different ways.

    This works fine and takes almost no time.

    I also have code that sets the print area, depending on the list
    arrangement, and then prints.

    This works OK.

    The problem is that once the print code has been run it takes ages - enough
    time to take the dog for a walk - for the list handling code to run.

    Any ideas ?

    Don




  2. #2
    keepITcool
    Guest

    Re: Macro Speed

    yep.


    'forces the pagebreaks on a new worksheet
    ActiveWindow.View = xlPageBreakPreview
    ActiveWindow.View = xlNormalView

    'NOW you can disable the display of the pagebreaks
    activesheet.DisplayAutomaticPageBreaks = False
    activesheet.DisplayPageBreaks = False




    --
    keepITcool
    | www.XLsupport.com | keepITcool chello nl | amsterdam


    Don Lloyd wrote :

    > Hi,
    >
    > I have a worksheet with a list of approx. 1,000 rows and 16 columns.
    >
    > A macro is used to run some fairly complex code to arrange the list
    > in different ways.
    >
    > This works fine and takes almost no time.
    >
    > I also have code that sets the print area, depending on the list
    > arrangement, and then prints.
    >
    > This works OK.
    >
    > The problem is that once the print code has been run it takes ages -
    > enough time to take the dog for a walk - for the list handling code
    > to run.
    >
    > Any ideas ?
    >
    > Don


  3. #3
    Don Lloyd
    Guest

    Re: Macro Speed

    Thanks a million,

    Is it necessary to set both types of PageBreaks to false?

    Don

    "keepITcool" <xrrcvgpbby@puryyb.ay> wrote in message
    news:xn0e5abdfliz15g003keepitcoolnl@news.microsoft.com...
    > yep.
    >
    >
    > 'forces the pagebreaks on a new worksheet
    > ActiveWindow.View = xlPageBreakPreview
    > ActiveWindow.View = xlNormalView
    >
    > 'NOW you can disable the display of the pagebreaks
    > activesheet.DisplayAutomaticPageBreaks = False
    > activesheet.DisplayPageBreaks = False
    >
    >
    >
    >
    > --
    > keepITcool
    > | www.XLsupport.com | keepITcool chello nl | amsterdam
    >
    >
    > Don Lloyd wrote :
    >
    >> Hi,
    >>
    >> I have a worksheet with a list of approx. 1,000 rows and 16 columns.
    >>
    >> A macro is used to run some fairly complex code to arrange the list
    >> in different ways.
    >>
    >> This works fine and takes almost no time.
    >>
    >> I also have code that sets the print area, depending on the list
    >> arrangement, and then prints.
    >>
    >> This works OK.
    >>
    >> The problem is that once the print code has been run it takes ages -
    >> enough time to take the dog for a walk - for the list handling code
    >> to run.
    >>
    >> Any ideas ?
    >>
    >> Don




  4. #4
    keepITcool
    Guest

    Re: Macro Speed

    not sure, wont hurt.

    --
    keepITcool
    | www.XLsupport.com | keepITcool chello nl | amsterdam


    Don Lloyd wrote :

    > Thanks a million,
    >
    > Is it necessary to set both types of PageBreaks to false?
    >
    > Don
    >
    > "keepITcool" <xrrcvgpbby@puryyb.ay> wrote in message
    > news:xn0e5abdfliz15g003keepitcoolnl@news.microsoft.com...
    > > yep.
    > >
    > >
    > > 'forces the pagebreaks on a new worksheet
    > > ActiveWindow.View = xlPageBreakPreview
    > > ActiveWindow.View = xlNormalView
    > >
    > > 'NOW you can disable the display of the pagebreaks
    > > activesheet.DisplayAutomaticPageBreaks = False
    > > activesheet.DisplayPageBreaks = False
    > >
    > >
    > >
    > >
    > > -- keepITcool
    > > > www.XLsupport.com | keepITcool chello nl | amsterdam

    > >
    > >
    > > Don Lloyd wrote :
    > >
    > > > Hi,
    > > >
    > > > I have a worksheet with a list of approx. 1,000 rows and 16
    > > > columns.
    > > >
    > > > A macro is used to run some fairly complex code to arrange the
    > > > list in different ways.
    > > >
    > > > This works fine and takes almost no time.
    > > >
    > > > I also have code that sets the print area, depending on the list
    > > > arrangement, and then prints.
    > > >
    > > > This works OK.
    > > >
    > > > The problem is that once the print code has been run it takes
    > > > ages - enough time to take the dog for a walk - for the list
    > > > handling code to run.
    > > >
    > > > Any ideas ?
    > > >
    > > > Don


  5. #5
    Don Lloyd
    Guest

    Re: Macro Speed

    Thanks again,

    I just added
    Activesheet.DisplayPageBreaks = False
    to the end of the print code and it worked fine.

    Don

    "keepITcool" <xrrcvgpbby@puryyb.ay> wrote in message
    news:xn0e5aclnlklude006keepitcoolnl@news.microsoft.com...
    > not sure, wont hurt.
    >
    > --
    > keepITcool
    > | www.XLsupport.com | keepITcool chello nl | amsterdam
    >
    >
    > Don Lloyd wrote :
    >
    >> Thanks a million,
    >>
    >> Is it necessary to set both types of PageBreaks to false?
    >>
    >> Don
    >>
    >> "keepITcool" <xrrcvgpbby@puryyb.ay> wrote in message
    >> news:xn0e5abdfliz15g003keepitcoolnl@news.microsoft.com...
    >> > yep.
    >> >
    >> >
    >> > 'forces the pagebreaks on a new worksheet
    >> > ActiveWindow.View = xlPageBreakPreview
    >> > ActiveWindow.View = xlNormalView
    >> >
    >> > 'NOW you can disable the display of the pagebreaks
    >> > activesheet.DisplayAutomaticPageBreaks = False
    >> > activesheet.DisplayPageBreaks = False
    >> >
    >> >
    >> >
    >> >
    >> > -- keepITcool
    >> > > www.XLsupport.com | keepITcool chello nl | amsterdam
    >> >
    >> >
    >> > Don Lloyd wrote :
    >> >
    >> > > Hi,
    >> > >
    >> > > I have a worksheet with a list of approx. 1,000 rows and 16
    >> > > columns.
    >> > >
    >> > > A macro is used to run some fairly complex code to arrange the
    >> > > list in different ways.
    >> > >
    >> > > This works fine and takes almost no time.
    >> > >
    >> > > I also have code that sets the print area, depending on the list
    >> > > arrangement, and then prints.
    >> > >
    >> > > This works OK.
    >> > >
    >> > > The problem is that once the print code has been run it takes
    >> > > ages - enough time to take the dog for a walk - for the list
    >> > > handling code to run.
    >> > >
    >> > > Any ideas ?
    >> > >
    >> > > Don




+ 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