Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2000 and Excel 2003 in Office 2003 | New Users to Excel | |||
Upgrade from Excel 2000 to Excel 2003 without MS Office 2003? | Excel Discussion (Misc queries) | |||
excel 2000 and 2003 | Excel Discussion (Misc queries) | |||
Excel 2000 vs 2003 | Excel Programming | |||
Excel 2000 and 2003 | Excel Programming |