Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Deleting all rows after the last active cell Shirley Munro[_7_] Excel Programming 2 September 28th 05 08:53 AM
Deleting rows based on a cell value JPriest Excel Worksheet Functions 3 August 12th 05 05:44 PM
Deleting rows if cell is blank Darren Elsom Excel Programming 3 March 4th 05 07:50 PM
Deleting rows by name in cell CPower[_3_] Excel Programming 4 June 3rd 04 09:28 PM
Deleting Rows from using a target cell Mike[_43_] Excel Programming 1 August 11th 03 06:19 PM


All times are GMT +1. The time now is 11:07 PM.

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

About Us

"It's about Microsoft Excel"