A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Links and Linking
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Macro for deleting rows and serialising the remaing rows



 
 
Thread Tools Display Modes
  #1  
Old November 12th, 2008, 01:29 PM posted to microsoft.public.excel.links
Srinivasulu Bhattaram
external usenet poster
 
Posts: 14
Default Macro for deleting rows and serialising the remaing rows

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



  #2  
Old November 13th, 2008, 09:44 AM posted to microsoft.public.excel.links
Bill Manville
external usenet poster
 
Posts: 258
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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.