ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Time to Unhide an Entire Column (https://www.excelbanter.com/excel-programming/417153-time-unhide-entire-column.html)

Barb Reinhardt

Time to Unhide an Entire Column
 
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



Bernie Deitrick

Time to Unhide an Entire Column
 
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

--
HTH,
Bernie
MS Excel MVP


"Barb Reinhardt" wrote in message
...
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





Dave Peterson

Time to Unhide an Entire Column
 
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

Barb Reinhardt wrote:

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


--

Dave Peterson

Barb Reinhardt

Time to Unhide an Entire Column
 
I should have mentioned that I've already turned off screen updating,
calculation and events. Any other suggestions?

Thanks,
Barb Reinhardt

"Bernie Deitrick" wrote:

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

--
HTH,
Bernie
MS Excel MVP


"Barb Reinhardt" wrote in message
...
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







All times are GMT +1. The time now is 02:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com