Time to Unhide an Entire Column

B

Barb Reinhardt

I am unhiding a column using this line

r.entirecolumn.hidden = false

were r is one cell and is defined as a RANGE. It's taking 39 seconds per
column to unhide. It's been working to unhide another column the whole time
I've been writing this question and still isn't done. This is excessive.
It didn't use to take this long. Has anyone seen this behavior. I'm using
Excel 2003. Any suggestions on how to address it?

Thanks,
Barb Reinhardt
 
B

Bernie Deitrick

Barb,

Try


With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
.EnableEvents = False
.DisplayAlerts = False

r.entirecolumn.hidden = false

.ScreenUpdating = True
.EnableEvents = True
.DisplayAlerts = True
.Calculation = xlCalculationAutomatic
End With
 
D

Dave Peterson

Option Explicit
Sub testme()

Dim CalcMode As Long
Dim ViewMode As Long

Application.ScreenUpdating = False

CalcMode = Application.Calculation
Application.Calculation = xlCalculationManual

ViewMode = ActiveWindow.View
ActiveWindow.View = xlNormalView

ActiveSheet.DisplayPageBreaks = False

'do the work

'put things back to what they were
Application.Calculation = CalcMode
ActiveWindow.View = ViewMode

End Sub

=======
And maybe you could unhide multiple columns at once???

dim r as range
with activesheet
set r = .range("a1,c9,e15,h2:k2,z1")
end with

r.entirecolumn.hidden = false
 
B

Barb Reinhardt

I should have mentioned that I've already turned off screen updating,
calculation and events. Any other suggestions?

Thanks,
Barb Reinhardt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top