Thread: One more macro
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Grace[_4_] Grace[_4_] is offline
external usenet poster
 
Posts: 106
Default One more macro

Actually, there is one other little problem. Usually, these files can have
10,000 rows. It seems like this takes maybe 10 minutes. Is there a way to
make this measurably faster, other than upgrading my year-old computer?
Something like turning calc off or screenupdating off? If so, kindly tell
me the commands.

D

"mudraker " wrote in message
...
Grace


It looks like a . disappeeared out of my code some how


My code looks upwards in column A from the very last row until it
finds an entry in column A

As you last row of totals does not have an entry in column A my code
does not see that row


This version finds the last used row on the sheet regardsless of which
column that entry


Sub Take3()
Dim lRow As Long

For lRow = Cells.Find(what:="*", _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row To 21 Step -1

If Not IsNumeric(Cells(lRow, "a")) _
Or Cells(lRow, "a") = "" Then
Rows(lRow).Delete
End If

Next lRow

lRow = Cells.Find(what:="*", SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
Range("a21:e" & lRow).Sort _
Key1:=Range("B21"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom

End Sub


---
Message posted from http://www.ExcelForum.com/