Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting row unless certain values in certain columns
I need to delete rows unless they have " Return To Tsr " (A space
before and after the phrase) in column O OR " Sales " (A space before and after the word) in column Q. I have had trouble getting this done right. What I am working with currently is below. I appreciate any help you can provide. Thanks Kris Sub Day1TSR() Dim row As Long row = FindLastRow Sheets("Day 1").Select Selection.AutoFilter Field:=15, Criteria1:=" Return To Tsr " ActiveWindow.ScrollColumn = 1 Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select Application.CutCopyMode = False Selection.Copy Sheets("Working").Select Worksheets("Working").Cells(row, 1).Select ActiveSheet.Paste Sheets("Day 1").Select Range("A1").Activate Selection.AutoFilter Application.Run ("QueryUpdate") End Sub Sub Day1Sales() Dim row As Long row = FindLastRow Sheets("Day 1").Select Selection.AutoFilter Field:=17, Criteria1:=" Sales " ActiveWindow.ScrollColumn = 1 Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select Application.CutCopyMode = False Selection.Copy Sheets("Working").Select Worksheets("Working").Cells(row, 1).Select ActiveSheet.Paste Sheets("Day 1").Select Range("A1").Activate Selection.AutoFilter Application.Run ("Day1TSR") End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding Columns, Then deleting old columns | Excel Discussion (Misc queries) | |||
Combining Text from 2 Columns into 1 then Deleting the 2 Columns | Excel Worksheet Functions | |||
Deleting row unless certain values in certain columns | Excel Programming | |||
Deleting Columns | Excel Programming | |||
deleting values in a worksheet without deleting the formulas | Excel Worksheet Functions |