Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default 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
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
Advanced sorting Gerben Dirksen Excel Worksheet Functions 4 July 26th 08 07:16 PM
Advanced Sorting - urgent Jesseboat Excel Worksheet Functions 1 November 14th 06 07:17 PM
Advanced Sorting - urgent Jesseboat Excel Worksheet Functions 0 November 14th 06 05:54 PM
Advanced Sorting #'s?? Missy Excel Discussion (Misc queries) 3 April 12th 06 11:37 PM
Advanced Sorting/Result cecman Excel Worksheet Functions 0 February 25th 05 09:25 PM


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