Group:  Microsoft Excel ยป microsoft.public.excel.links
Thread: Macro for deleting rows and serialising the remaing rows

Macro for deleting rows and serialising the remaing rows
"Srinivasulu Bhattaram" <bhattarams[ at ]gmail.com> 11/12/2008 12:29:35 PM
Macro for deleting rows and serialising the remaing rows
====================================================

I have a spread sheet

It's a ToDo List



The structure is like this

Column A Sl No

Column B Task

Column C Person

Column D Completed



To start with I keep entering the tasks in one stretch and take a print out.

The first Column (A) will be a serialized.

I wil be using this print out for few days.

After two/three days, I would like to open the spread sheet and enter fresh
tasks

For all completed tasks I put x in Col D.

What I currently require is a macro to



1.. Remove all rows where Column D contains 'x" (quotes not included.)
2.. After this operation, contents of Column A will have to be serialsed.


seena




---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 081111-0, 11/11/2008
Tested on: 11/12/2008 5:59:36 PM
avast! - copyright (c) 1988-2008 ALWIL Software.
http://www.avast.com



Re: Macro for deleting rows and serialising the remaing rows
Bill Manville <Bill-Manville[ at ]msn.com> 11/13/2008 8:44:55 AM
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

Home | Search | Terms | Imprint
Newsgroups Reader