Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2007 is slow when you hide columns on .xls

Hi everybody, I have a macro that hide a few columns on excel model 2003, but
acttually i'm using excel 2007 and is too slow, to hide this columns takes 1
minutes, here is the code.

Application.ScreenUpdating = False
Application.Calculation = xlManual

With ActiveSheet
For i = 1 To 11
Worksheets(aNombreHojas).Columns(5 + i).Hidden = true
Next
End With

Application.ScreenUpdating = True
Application.Calculation = xlAutomatic
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default Excel 2007 is slow when you hide columns on .xls

Diego Anaya wrote:
Hi everybody, I have a macro that hide a few columns on excel model 2003, but
acttually i'm using excel 2007 and is too slow, to hide this columns takes 1
minutes, here is the code.

Application.ScreenUpdating = False
Application.Calculation = xlManual

With ActiveSheet
For i = 1 To 11
Worksheets(aNombreHojas).Columns(5 + i).Hidden = true
Next
End With

Application.ScreenUpdating = True
Application.Calculation = xlAutomatic


Runs instantly here. Are there graphs/charts/shapes in the hidden
columns or on the sheet with the columns being hidden?

Or other OnAction events being triggered .

Worksheets(1).Columns("F:P").Hidden = True

Might be faster if the problem is redraw related. I have noticed that in
some complex circustances ScreenUpdating = False *slows* down XL2007.

Regards,
Martin Brown
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Excel 2007 is slow when you hide columns on .xls

I didn't test this, but since you're hiding 11 contiguous columns, maybe just
doing them all at once would help:

Worksheets(aNombreHojas).cells(1,6).resize(1,11).e ntirecolumn.Hidden = true

ps.

You can drop that outer "with Activesheet/End with" structure. You're not
doing anything against the activesheet. (Well, not in the code you shared...)

Diego Anaya wrote:

Hi everybody, I have a macro that hide a few columns on excel model 2003, but
acttually i'm using excel 2007 and is too slow, to hide this columns takes 1
minutes, here is the code.

Application.ScreenUpdating = False
Application.Calculation = xlManual

With ActiveSheet
For i = 1 To 11
Worksheets(aNombreHojas).Columns(5 + i).Hidden = true
Next
End With

Application.ScreenUpdating = True
Application.Calculation = xlAutomatic


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default Excel 2007 is slow when you hide columns on .xls

With ActiveSheet
Columns("F:P").EntireColumn.Hidden = True
End With


"Diego Anaya" skrev:

Hi everybody, I have a macro that hide a few columns on excel model 2003, but
acttually i'm using excel 2007 and is too slow, to hide this columns takes 1
minutes, here is the code.

Application.ScreenUpdating = False
Application.Calculation = xlManual

With ActiveSheet
For i = 1 To 11
Worksheets(aNombreHojas).Columns(5 + i).Hidden = true
Next
End With

Application.ScreenUpdating = True
Application.Calculation = xlAutomatic

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
slow to open Excel 2007 and Word 2007 (MIS stumped) JoAnn Excel Discussion (Misc queries) 0 December 11th 08 03:07 PM
Excel 2007 - Hide & Unhide Columns/Rows leahl Excel Discussion (Misc queries) 8 November 5th 08 09:17 PM
Excel 2003: VBA - Hide Rows process now too slow BEEJAY Excel Programming 1 February 13th 08 10:54 PM
excel 2007 slow jojobold Excel Discussion (Misc queries) 4 February 27th 07 12:15 PM
Excel button :: Filter columns by value - possible? Additionally, hide certain columns No Name Excel Programming 4 December 28th 04 07:44 PM


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

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

About Us

"It's about Microsoft Excel"