View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
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.