Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting rows when a certain cell has a certain value
Hi, Can someone help me with the next problem? I would like to create a Macro which deletes the line if the date value in a certain column is in the past. Thanks for your feedback, Leentje -- Leentje ------------------------------------------------------------------------ Leentje's Profile: http://www.excelforum.com/member.php...o&userid=37223 View this thread: http://www.excelforum.com/showthread...hreadid=572528 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting rows when a certain cell has a certain value
Hi paste this code in to the worksheet module, every time the sheet i activated it will search through the specified range and delet everything older than today! Hope it helps. Regards, Simon Option Explicit Private Sub Worksheet_Activate() Dim mycell Dim rng As Range Set rng = Range("A1:A100") For Each mycell In rng If mycell.Value < Date Then Application.ScreenUpdating = False mycell.EntireRow.Delete End If Next Application.ScreenUpdating = True End Su -- Simon Lloy ----------------------------------------------------------------------- Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670 View this thread: http://www.excelforum.com/showthread.php?threadid=57252 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting rows when a certain cell has a certain value
When executing this macro, the odd lines are not checked. When executing the macro again various times the final result is ok. So I think I need to add some additional code to solve this... Can you help -- Leentj ----------------------------------------------------------------------- Leentje's Profile: http://www.excelforum.com/member.php...fo&userid=3722 View this thread: http://www.excelforum.com/showthread.php?threadid=57252 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Deleting all rows after the last active cell | Excel Programming | |||
Deleting rows based on a cell value | Excel Worksheet Functions | |||
Deleting rows if cell is blank | Excel Programming | |||
Deleting rows by name in cell | Excel Programming | |||
Deleting Rows from using a target cell | Excel Programming |