Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
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
Excel 2000 and Excel 2003 in Office 2003 Emon New Users to Excel 0 December 21st 06 09:11 AM
Upgrade from Excel 2000 to Excel 2003 without MS Office 2003? brigida3 Excel Discussion (Misc queries) 1 January 22nd 06 05:13 PM
excel 2000 and 2003 cwwolfdog Excel Discussion (Misc queries) 1 March 29th 05 01:32 PM
Excel 2000 vs 2003 John Baker Excel Programming 0 December 28th 04 06:01 PM
Excel 2000 and 2003 Leon[_4_] Excel Programming 2 February 18th 04 03:22 PM


All times are GMT +1. The time now is 11:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"