Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have built a macro that filters my sheet; I then want to remove these rows leaving no spaces and only the rows with remaining criteria. I can do all this, no problem. The problem occurs when the rows change, as this is a variable set of data. When I send the excel to the cell one below A1, while filtered, it always returns a reference. i.e. below on line 5. I need this to be variable. Can anyone please help a man on the brink of tears......? Thank you in advance ' Sub removing_split_Rate() Sheets("Invoice Detail").Select Cells.Select Selection.AutoFilter Selection.AutoFilter Field:=26, Criteria1:="Split" Range("A92").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select Selection.Delete Shift:=xlUp Range("A575").Select ActiveWindow.ScrollColumn = 2 ActiveWindow.ScrollColumn = 4 ActiveWindow.ScrollColumn = 5 ActiveWindow.ScrollColumn = 6 ActiveWindow.ScrollColumn = 7 ActiveWindow.ScrollColumn = 8 ActiveWindow.ScrollColumn = 9 ActiveWindow.ScrollColumn = 10 ActiveWindow.ScrollColumn = 11 ActiveWindow.ScrollColumn = 12 ActiveWindow.ScrollColumn = 13 ActiveWindow.ScrollColumn = 14 ActiveWindow.ScrollColumn = 15 ActiveWindow.ScrollColumn = 16 ActiveWindow.ScrollColumn = 17 ActiveWindow.ScrollColumn = 18 ActiveWindow.ScrollColumn = 19 Selection.AutoFilter Field:=26 Range(Selection, Selection.End(xlUp)).Select Selection.End(xlUp).Select Selection.End(xlUp).Select Range("A1").Select Selection.End(xlUp).Select Range("A2").Select Sheets("Invoice Detail - Split").Select Range("A2").Select Selection.AutoFilter Selection.AutoFilter Field:=26, Criteria1:="17.5" Range("A2").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select Selection.Delete Shift:=xlUp Selection.AutoFilter Field:=26, Criteria1:="5" Range("A2").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select Selection.Delete Shift:=xlUp Range("AA40").Select Selection.AutoFilter Field:=26 Range("A2").Select Selection.End(xlToLeft).Select Selection.AutoFilter Sheets("Invoice Detail").Select Selection.AutoFilter |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sorting or filtering the rows | Excel Discussion (Misc queries) | |||
How do I Copy and Paste onto Same Rows after filtering out rows. | Excel Discussion (Misc queries) | |||
Filtering Rows ? | Excel Worksheet Functions | |||
Removing (deleting, filtering) lines in a pattern . . . | Excel Discussion (Misc queries) | |||
Removing Empty Rows and selecting Specific Rows | Excel Programming |