Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel 2010
When I run this code it takes a tiny bit less than one second for each entry with no "X" in the column to the left and at least a full second if it has to cut & paste the resized cells in response to the "X" in the column to the left. The worksheet also seems to be slower than normal using common sheet procedures like selecting a couple of cells and draging them to another column, same slowness with cut and paste of 150 to 250 entries in a column to another column. The sheets data is about 50 columns by 300 rows and a "storage column" just over 1000 rows. Doesn't seem like much data after some examples I have heard about in these news groups. I'm going on poor memory here now, but I seem to recall some reason for slowness may be a HUGE used range on the sheet. Cure was something like selectin all the empty rows beyond what you need and do something with them and then do the same with the columns. Save and restate Excel might be part of the cure also. I have used Ctrl + down arrow several times and gone to the million'th plus row (bottom of the column). Maybe thats it??? Any ideas? Option Explicit Sub CopyLeft() 'activecell must start row 1 to row 16 of column Dim c As Range Dim j As Integer ActiveCell.End(xlDown).Select j = ActiveCell.End(xlDown).Row ActiveCell.Resize(j - 16, 1).Select With Selection For Each c In Selection If c.Offset(0, -1).Value = "X" Then c.Resize(1, 2).Cut c.Offset(0, -2) End If Next End With End Sub Thanks. Regards, Howard |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Fast code in 2003 = agonizingly slow code in 2007 | Excel Programming | |||
Run VBA code only worksheet change, but don't trigger worksheet_change event based on what the code does | Excel Programming | |||
Issue with code execution -- it is very slow | Excel Programming | |||
Code issue - before_save() - Filename with date stamp - worksheet | Excel Programming | |||
Slow code when used as VBA code instead of macro (copying visible columns) | Excel Programming |