LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Autofil on variable rows, delete extract and show remaining rows

Dear All,

I would like to automate the code below:
Sub Macro2()
Rows("1:1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=3, Criteria1:="<=08/03/2004",
Operator:=xlAnd
Rows("12:12").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
Selection.AutoFilter Field:=3
End Sub


The problem is that when I use the editor to record the macro, the
range is fixed because I click the cell to autofil. I will have varing
amount of rows and hence the need to automate a code to recognise
this.

Below is a sample of what I am trying to do and the data.

(1) Insert Autofilter in header row 1
(2) Column B custom to less than or equal to 08/03/2004
(3) Delete entire result with variable autofil of rows upto
08/03/2004
(4) View remaining data over 08/03/2004
(5) Remove Autofilter


Invoice Invoice Date Date Paid Amount
PKR41 03/11/2003 08/06/2004 1222.81
11803 16/01/2004 17/05/2004 1045.75
011847 13/02/2004 17/05/2004 199.75
011881 27/02/2004 21/07/2004 199.75
011882 27/02/2004 21/07/2004 199.75
011888 02/03/2004 08/06/2004 504.07
11886 02/03/2004 19/07/2004 6835.42
11901 08/03/2004 08/06/2004 26502.12
11909 10/03/2004 28/05/2004 9165
011918 15/03/2004 17/05/2004 199.75
016996 03/03/2009 03/04/2009 2162
016997 03/03/2009 03/04/2009 3979
017002 04/03/2009 03/04/2009 3588
017034 12/03/2009 03/04/2009 6171.49
017036 13/03/2009 14/04/2009 1403
017037 13/03/2009 14/04/2009 3812.25
017039 13/03/2009 15/04/2009 97750
017038 13/03/2009 14/04/2009 97750
017052 23/03/2009 21/04/2009 290.95

Kind Regards

1plane
 
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
Delete Rows based on # of rows (no variable?) DanaK Excel Programming 7 November 3rd 08 12:11 AM
Variable criteria to delete rows Jeff Bertram Excel Programming 18 July 21st 08 07:30 PM
Delete variable # of rows depending on conditions Pman Excel Programming 5 September 27th 07 03:27 PM
how to delete rows that show no value but contain formulas Liliana[_5_] Excel Programming 5 July 15th 04 08:56 PM
Delete all Rows in a Variable Range John[_78_] Excel Programming 3 June 30th 04 06:13 PM


All times are GMT +1. The time now is 06:40 AM.

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"