View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.links
Bill Manville Bill Manville is offline
external usenet poster
 
Posts: 473
Default Macro for deleting rows and serialising the remaing rows

Not sure why you chose the Links group for this post - Programming
would be more appropriate, but anyway your macro would be something
like this:

Sub CleanUp()
' assumes the data starts at A1 and has titles in row 1
Dim lRow As Long
With Range("A1").CurrentRegion
For lRow = .Rows.Count To 2 Step -1
If .Cells(lRow, 4)="x" then .Rows(lRow).Delete shift:=xlUp
Next
.Sort key1:=Range("A1"), order1:=xlAscending, header:=xlYes
End With
End Sub

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup