LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 2,480
Default Macro for deleting rows and serialising the remaing rows

Hi Seena

This should do what you want

Sub RemoveCompletedRows()
Dim i As Long, lr As Long

lr = ActiveSheet.UsedRange.Rows.Count
For i = lr To 2 Step -1
If UCase(Cells(i, "D")) = "X" Then
Rows(i).Delete
End If
Next i
lr = ActiveSheet.UsedRange.Rows.Count
For i = 1 To lr - 1
Cells(i + 1, "A") = i
Next i

End Sub

--
Regards
Roger Govier

"Srinivasulu Bhattaram" wrote in message
...
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 6:00:16 PM
avast! - copyright (c) 1988-2008 ALWIL Software.
http://www.avast.com



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MACRO HELP - deleting rows containing a range of blank cells DavidHawes Excel Discussion (Misc queries) 9 February 26th 07 03:40 PM
Macro Help Needed: Comparing cell values and deleting rows [email protected] Excel Discussion (Misc queries) 1 September 19th 06 02:39 AM
Deleting rows with macro PhilScratchingmyhead Excel Worksheet Functions 2 June 29th 06 05:55 PM
Macro deleting specified rows Snoopy Charts and Charting in Excel 0 February 15th 06 12:56 PM
Deleting rows in a macro in Excel THEFALLGUY Excel Discussion (Misc queries) 4 December 23rd 05 01:59 PM


All times are GMT +1. The time now is 01:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"