Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Script to make my life easier??

Hello from a new forum user. Can anybody help? I would like to automat
the process of deleting a series of lines from a spredsheet. The line
that need to be delted, have a field entiltled "Date of Leaving", and
need to remove any rows where the date in this column occurs before 1s
April 2003. Any help would be greatly appreciated. Thanks guy

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Script to make my life easier??

Try this one with the dates in Column A

Sub Delete_with_Autofilter()
Dim DeleteValue As String
Dim rng As Range

DeleteValue = "<4/1/2003"

With ActiveSheet
.Columns("A").AutoFilter Field:=1, Criteria1:=DeleteValue
With ActiveSheet.AutoFilter.Range
On Error Resume Next
Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not rng Is Nothing Then rng.EntireRow.Delete

End With
.AutoFilterMode = False
End With
End Sub

--
Regards Ron de Bruin
http://www.rondebruin.nl


"dvshooter " wrote in message ...
Hello from a new forum user. Can anybody help? I would like to automate
the process of deleting a series of lines from a spredsheet. The lines
that need to be delted, have a field entiltled "Date of Leaving", and I
need to remove any rows where the date in this column occurs before 1st
April 2003. Any help would be greatly appreciated. Thanks guys


---
Message posted from http://www.ExcelForum.com/



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
Help with a procedure to make things easier Bill Excel Discussion (Misc queries) 6 February 7th 10 09:59 PM
Make easier to use formula's / have better / useful examples nastech Excel Discussion (Misc queries) 1 October 30th 07 01:19 AM
Please make it easier to access the IS functions (e.g., isblank) . melyndac2005 Excel Worksheet Functions 9 August 28th 05 05:06 AM
Need a formula that would make life easier frustrated New Users to Excel 2 May 29th 05 04:15 PM
Need a formula that would make life easier Frustrated Excel Worksheet Functions 1 May 29th 05 02:59 PM


All times are GMT +1. The time now is 03:24 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"