+ Reply to Thread
Results 1 to 4 of 4

Excel 2000 vs 2003

  1. #1
    Simon Shaw
    Guest

    Excel 2000 vs 2003

    Hi,

    the following code runs very quickly in Excel 2000, but very slowly in Excel
    2003:

    With ActiveSheet
    For x = 1 To .Cells.SpecialCells(xlLastCell)
    With .Cells(x, 1)
    With .EntireRow
    If .Hidden = False Then
    .AutoFit
    End If
    End With
    End With
    Next x
    End With

    ideas?

    Thanks

    Simon

  2. #2
    Simon Shaw
    Guest

    RE: Excel 2000 vs 2003


    Code line:
    For x = 1 To .Cells.SpecialCells(xlLastCell)
    is actually:
    For x = 1 To .Cells.SpecialCells(xlLastCell).Row


    "Simon Shaw" wrote:

    > Hi,
    >
    > the following code runs very quickly in Excel 2000, but very slowly in Excel
    > 2003:
    >
    > With ActiveSheet
    > For x = 1 To .Cells.SpecialCells(xlLastCell)
    > With .Cells(x, 1)
    > With .EntireRow
    > If .Hidden = False Then
    > .AutoFit
    > End If
    > End With
    > End With
    > Next x
    > End With
    >
    > ideas?
    >
    > Thanks
    >
    > Simon


  3. #3
    Dave Peterson
    Guest

    Re: Excel 2000 vs 2003

    Sometimes, it's not the version of excel, but the fact that you're unhiding
    rows.

    Maybe adding:
    ActiveSheet.DisplayPageBreaks = False
    would help.

    But xl2003 also changed the way it calculates (manually hidden rows in an
    autofiltered range can be excluded from the =subtotal() function).

    Maybe turning off calculation would help:

    Option Explicit
    Sub yoursub()

    Dim CalcMode As Long
    CalcMode = Application.Calculation
    ActiveSheet.DisplayPageBreaks = False

    'your code

    Application.Calculation = CalcMode

    End Sub

    Simon Shaw wrote:
    >
    > Hi,
    >
    > the following code runs very quickly in Excel 2000, but very slowly in Excel
    > 2003:
    >
    > With ActiveSheet
    > For x = 1 To .Cells.SpecialCells(xlLastCell)
    > With .Cells(x, 1)
    > With .EntireRow
    > If .Hidden = False Then
    > .AutoFit
    > End If
    > End With
    > End With
    > Next x
    > End With
    >
    > ideas?
    >
    > Thanks
    >
    > Simon


    --

    Dave Peterson

  4. #4

    Re: Excel 2000 vs 2003

    Even adding the suggested lines the macro is much more fast in Excel
    2000.

    Regards
    Hamilton R. Romano

    Dave Peterson wrote:
    > Sometimes, it's not the version of excel, but the fact that you're

    unhiding
    > rows.
    >
    > Maybe adding:
    > ActiveSheet.DisplayPageBreaks = False
    > would help.
    >
    > But xl2003 also changed the way it calculates (manually hidden rows

    in an
    > autofiltered range can be excluded from the =subtotal() function).
    >
    > Maybe turning off calculation would help:
    >
    > Option Explicit
    > Sub yoursub()
    >
    > Dim CalcMode As Long
    > CalcMode = Application.Calculation
    > ActiveSheet.DisplayPageBreaks = False
    >
    > 'your code
    >
    > Application.Calculation = CalcMode
    >
    > End Sub
    >
    > Simon Shaw wrote:
    > >
    > > Hi,
    > >
    > > the following code runs very quickly in Excel 2000, but very slowly

    in Excel
    > > 2003:
    > >
    > > With ActiveSheet
    > > For x = 1 To .Cells.SpecialCells(xlLastCell)
    > > With .Cells(x, 1)
    > > With .EntireRow
    > > If .Hidden = False Then
    > > .AutoFit
    > > End If
    > > End With
    > > End With
    > > Next x
    > > End With
    > >
    > > ideas?
    > >
    > > Thanks
    > >
    > > Simon

    >
    > --
    >
    > Dave Peterson



+ 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