S
Sauron
Hi There,
I have recently cobbled together some code to strip out empty cells
from a row of information, unfortunately it runs extremely slowly,
could anyone suggest a way of making this following code more efficient
so it doesen't take 2mins+ to run?
Sub RemEmptyFinal()
Application.ScreenUpdating = False
Dim rng As Range, ix As Long
'Sheet1
Sheets("AOwens").Select
Sheet1.Range("W2:W1000").Select
Selection.Copy
Sheet1.Range("U2").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
True, Transpose:=False
Set rng = Intersect(Selection, ActiveSheet.UsedRange)
If rng Is Nothing Then
GoTo done
End If
-For ix = rng.Count To 1 Step -1
If Len(Trim(Replace(rng.Item(ix).Formula, Chr(160), ""))) _
= 0 Then rng.Item(ix).Delete (xlUp)-
Sheet1.Range("A1").Select
Next
~*~*~*
Thanks all, I am extremely grateful for any suggestions.
Sau
I have recently cobbled together some code to strip out empty cells
from a row of information, unfortunately it runs extremely slowly,
could anyone suggest a way of making this following code more efficient
so it doesen't take 2mins+ to run?
Sub RemEmptyFinal()
Application.ScreenUpdating = False
Dim rng As Range, ix As Long
'Sheet1
Sheets("AOwens").Select
Sheet1.Range("W2:W1000").Select
Selection.Copy
Sheet1.Range("U2").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
True, Transpose:=False
Set rng = Intersect(Selection, ActiveSheet.UsedRange)
If rng Is Nothing Then
GoTo done
End If
-For ix = rng.Count To 1 Step -1
If Len(Trim(Replace(rng.Item(ix).Formula, Chr(160), ""))) _
= 0 Then rng.Item(ix).Delete (xlUp)-
Sheet1.Range("A1").Select
Next
~*~*~*
Thanks all, I am extremely grateful for any suggestions.
Sau