Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 331
Default Sort all columns based on one colum

I have column N that has data validation of only "Yes" . i would like to move
the rows with the "Yes" value in column N to the bottom of the sort.
i have a sort button with this code below. What would i need to insert to do
this?
Sub SortSunday()
'
'Sort's Sundays Qualifying'
'

ActiveSheet.Unprotect Password:=""
With ActiveSheet
With .Range("B8", .Range("N8").End(xlDown))
.Sort Key1:=.Columns(12), Order1:=xlAscending, _
Key2:=.Columns(11), Order2:=xlDescending, _
Header:=xlYes
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True, Password:=""

End With
End With
End Sub

Many Thanks in Advance!
Greg
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Sort all columns based on one colum

Greg,

It depends on what values you have in column N other than Yes.

Bernie

"Greg" wrote in message
...
I have column N that has data validation of only "Yes" . i would like to
move
the rows with the "Yes" value in column N to the bottom of the sort.
i have a sort button with this code below. What would i need to insert to
do
this?
Sub SortSunday()
'
'Sort's Sundays Qualifying'
'

ActiveSheet.Unprotect Password:=""
With ActiveSheet
With .Range("B8", .Range("N8").End(xlDown))
.Sort Key1:=.Columns(12), Order1:=xlAscending, _
Key2:=.Columns(11), Order2:=xlDescending, _
Header:=xlYes
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True, Password:=""

End With
End With
End Sub

Many Thanks in Advance!
Greg


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 331
Default Sort all columns based on one colum

Thanks Bernie,
i was wondering if anyone understood what i was asking.
the column will be either blank or yes. i used data validation from list
with only yes as an option.

Thanks
Greg

"Bernie Deitrick" wrote:

Greg,

It depends on what values you have in column N other than Yes.

Bernie

"Greg" wrote in message
...
I have column N that has data validation of only "Yes" . i would like to
move
the rows with the "Yes" value in column N to the bottom of the sort.
i have a sort button with this code below. What would i need to insert to
do
this?
Sub SortSunday()
'
'Sort's Sundays Qualifying'
'

ActiveSheet.Unprotect Password:=""
With ActiveSheet
With .Range("B8", .Range("N8").End(xlDown))
.Sort Key1:=.Columns(12), Order1:=xlAscending, _
Key2:=.Columns(11), Order2:=xlDescending, _
Header:=xlYes
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True, Password:=""

End With
End With
End Sub

Many Thanks in Advance!
Greg


.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Sort all columns based on one colum

Greg,

I have assumed that column O (the one next to N) is available for use to help with sorting.

HTH,
Bernie
MS Excel MVP

Sub SortSunday()
'
'Sort's Sundays Qualifying'
'

ActiveSheet.Unprotect Password:=""
With ActiveSheet
With .Range("B8", .Range("M8").End(xlDown).Offset(0, 2))
.Columns(.Columns.Count).Cells.FormulaR1C1 = "=IF(RC[-1]=""Yes"",1,0)"
.Sort Key1:=.Columns(14), Order1:=xlAscending, _
Key2:=.Columns(12), Order2:=xlDescending, _
Key3:=.Columns(11), Order3:=xlDescending, _
Header:=xlYes
.Columns(.Columns.Count).Cells.Clear
ActiveSheet.Protect DrawingObjects:=True, _
Contents:=True, Scenarios:=True, Password:=""
End With
End With
End Sub




"Greg" wrote in message
...
Thanks Bernie,
i was wondering if anyone understood what i was asking.
the column will be either blank or yes. i used data validation from list
with only yes as an option.

Thanks
Greg

"Bernie Deitrick" wrote:

Greg,

It depends on what values you have in column N other than Yes.

Bernie

"Greg" wrote in message
...
I have column N that has data validation of only "Yes" . i would like to
move
the rows with the "Yes" value in column N to the bottom of the sort.
i have a sort button with this code below. What would i need to insert to
do
this?
Sub SortSunday()
'
'Sort's Sundays Qualifying'
'

ActiveSheet.Unprotect Password:=""
With ActiveSheet
With .Range("B8", .Range("N8").End(xlDown))
.Sort Key1:=.Columns(12), Order1:=xlAscending, _
Key2:=.Columns(11), Order2:=xlDescending, _
Header:=xlYes
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True, Password:=""

End With
End With
End Sub

Many Thanks in Advance!
Greg


.



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
Trying to enter a formula to sum a colum based on 2 condition Max of Newnan Excel Worksheet Functions 3 September 24th 09 09:35 PM
I am trying to lookup a cell based upon what is in row 3 and colum David A. Excel Discussion (Misc queries) 6 July 18th 07 09:10 PM
sum certain cells in a column based on criteria from another colum rainbowraven Excel Worksheet Functions 8 April 13th 07 02:05 AM
Locate max value of one column based on criteria in another colum JDay01 Excel Worksheet Functions 2 September 1st 05 06:47 PM
How can I group a bunch of cells together, so I can sort by colum. Pleasehelpme Excel Worksheet Functions 1 November 6th 04 04:06 AM


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