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,101
Default sort only rows with data

One way is to put a string of zeroes in the blank cell sort they get moved to
the lat rows. Then sort and remove the Z's

Sub SortRows()

Set SortColumn = Range("V11:V74")

For Each cell In SortColumn
If cell = "" Then
cell = "ZZZZZZZZZZZ"
End If
Next cell

Rows("11:74").Sort _
key1:=SortColumn, _
Order1:=xlAscending, _
header:=xlNo

SortColumn.Replace what:="ZZZZZZZZZZZ", replacement:=""


End Sub


"usmc-r70" wrote:

I have a spreadsheet with a data range from A11:AR74, with the sort column
being 'V'.

I need a macro button to sort rows 11:74 in assending order for those rows
with data in column 'V' greater than zero, leaving those rows with zero in
column 'V' below the 'populated' rows.

Additionally, I need to disable the manual sort and auto filter features,
leaving the macro button as the only means to sort on this worksheet.

 
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
Sort data with blank rows dividing data Sheila Excel Discussion (Misc queries) 5 November 21st 08 06:54 PM
Sort with blank rows between data rows Sheila Excel Discussion (Misc queries) 1 November 21st 08 02:23 PM
how do i sort data record on two rows? anyole Excel Worksheet Functions 13 July 7th 08 04:02 PM
How to sort data from rows into columns? crcurrie Excel Discussion (Misc queries) 6 March 8th 07 01:23 AM
How to sort data with rows that have subtotals nander Excel Discussion (Misc queries) 0 February 1st 06 05:02 PM


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