View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Test.File Test.File is offline
external usenet poster
 
Posts: 1
Default Range.Delete and Range.Resize.Name performance issues

I have some code that

a) Deletes cells in a range (Shift:=xlLeft)
b) Inserts cells (Shift:=xlToRight)
c) and then, resizes the ranges and assigns the same name.

Example:

Set Global_Board = Range("Select.Method.Results")
a)
Global_Board.Offset(-3, 1).Resize(NbLayerMax + 4, Global_Board.Columns.Count
- 1).Delete Shift:=xlToLeft

b & c) With Global_Board
.Offset(-3, 1).Resize(NbLayerMax + 4, NBMethod_Selected - 1).Insert
Shift:=xlToRight
.Resize(, NBMethod_Selected).name = "Select.Method.Results"
End With

There are 3 such ranges that these operations are being performed upon.

I've noticed that there's a signicant cumulative delay in performing these
steps when the code is run repeatedly. Over 20 iterations, it can grow to
several seconds. The size of the ranges is typically 10rx1c.

Is there a workaround? How else can I change this (inherited) code?

Thanks