Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Advanced sorting in a spreadsheet
In my already-populated Excel spreadhseet I want to:
- locate all the rows which contain the word "Robert" in Column "E" (only column "E"); - cut out the entire row - paste the entire row just after the end of the last row with data in it. - then remove the empty row from which they have been cut. However, the number of rows in the spreadsheet varies from day to day, so the last row with data in it cannot have an absolute value. Any ideas? Please advise. paddymichelle |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Advanced sorting in a spreadsheet
Ian M,
Try, Sub Macro10() LR = Range("E" & Rows.Count).End(xlUp).row Range("A1:F" & LR).AutoFilter _ Field:=5, Criteria1:="Robert" Range("E2:E" & LR) _ .SpecialCells(xlCellTypeVisible) _ .EntireRow.Copy _ Destination:=Range("A" & LR + 1) Range("E2:E" & LR) _ .SpecialCells(xlCellTypeVisible) _ .EntireRow.Delete Range("A1:F" & LR).AutoFilter End Sub Worked for me Cecil "Ian M" wrote in message om... In my already-populated Excel spreadhseet I want to: - locate all the rows which contain the word "Robert" in Column "E" (only column "E"); - cut out the entire row - paste the entire row just after the end of the last row with data in it. - then remove the empty row from which they have been cut. However, the number of rows in the spreadsheet varies from day to day, so the last row with data in it cannot have an absolute value. Any ideas? Please advise. paddymichelle |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Advanced sorting | Excel Worksheet Functions | |||
Advanced Sorting - urgent | Excel Worksheet Functions | |||
Advanced Sorting - urgent | Excel Worksheet Functions | |||
Advanced Sorting #'s?? | Excel Discussion (Misc queries) | |||
Advanced Sorting/Result | Excel Worksheet Functions |