Thread: code question
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default code question

Hi Gary,

Independently of your code, I would suggest that you expand the ScreenUpdate
wrapper to include calculation and (while you are at it) also include
pagebreak displays. somehing like:

Dim CalcMode As Long
Dim PgBreakMode As Boolean

With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With

With ActiveSheet
PgBreakMode = .DisplayPageBreaks
.DisplayPageBreaks = False
End With


' Your code



With Application
.Calculation = CalcMode
.ScreenUpdating = True
End With

ActiveSheet.DisplayPageBreaks = PgBreakMode

End Sub

---
Regards,
Norman