Thread: One more macro
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
mudraker[_249_] mudraker[_249_] is offline
external usenet poster
 
Posts: 1
Default One more macro

Grace

Here is the code for the first part of your request

Delete rows where cell in column a is not numeric & sort data

Deletion code starts from the last row and works back to row 21 as thi
is the easiest way to code row deletions



I did not understand fully where you wanted to copy A1 down to so di
not include that part in the code




Sub dddd()
Dim lRow As Long
For lRow = Range("a" & Rows.Count).End(xlUp).Row To 21 Step -1
If Not IsNumeric(Cells(lRow, "a")) Then
Rows(lRow).Delete
End If
Next lRow
lRow = Range("a" & Rows.Count).End(xlUp).Row
Range("a21:e" & lRow).Sort _
Key1:=Range("B21"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom

End Su

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