#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 440
Default Rank

Once I have 'ranked' the rows by a 'priority' number, how can I automatically
get rows with priority 1 to move to the top of the sheet followed by priority
2 and so on?
Also, how can I get rid of the #N/A error (still in RANK) in cells reporting
on incomplete data?
--
tia

Jock
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Rank

Jock,

You can avoid the NA error with:-

=IF(ISNA(RANK(A1,A$1:A$100)),"",RANK(A1,A$1:A$100) )

When you've ranked numbers you can do a data sort to get then in the order
you want.

Mike

"Jock" wrote:

Once I have 'ranked' the rows by a 'priority' number, how can I automatically
get rows with priority 1 to move to the top of the sheet followed by priority
2 and so on?
Also, how can I get rid of the #N/A error (still in RANK) in cells reporting
on incomplete data?
--
tia

Jock

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 440
Default Rank

Thanks Mike. Error sorted, although it ranked in decending order. Fixed it
though.
Rather than manually sort, can I automate the sorting so that for example,
when I prioritise something to '1' it moves from row 25 (or whatever) to row
1 an soon as '1' is entered in A25?
--
tia

Jock


"Mike H" wrote:

Jock,

You can avoid the NA error with:-

=IF(ISNA(RANK(A1,A$1:A$100)),"",RANK(A1,A$1:A$100) )

When you've ranked numbers you can do a data sort to get then in the order
you want.

Mike

"Jock" wrote:

Once I have 'ranked' the rows by a 'priority' number, how can I automatically
get rows with priority 1 to move to the top of the sheet followed by priority
2 and so on?
Also, how can I get rid of the #N/A error (still in RANK) in cells reporting
on incomplete data?
--
tia

Jock

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Rank

Jock,

I'm not aware of any worksheet function to do this but you could monitor A25
with the worksheet change event and if a 1 is enter call a macto:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Target.Address = "$A$25" Then
If Target.Value = 1 Then
MsgBox ("You put a 1 in A25")
'< delete the msgbox bit and record
' yourself doing your sort and paste it here
End If
End If
End Sub

Mike

"Jock" wrote:

Thanks Mike. Error sorted, although it ranked in decending order. Fixed it
though.
Rather than manually sort, can I automate the sorting so that for example,
when I prioritise something to '1' it moves from row 25 (or whatever) to row
1 an soon as '1' is entered in A25?
--
tia

Jock


"Mike H" wrote:

Jock,

You can avoid the NA error with:-

=IF(ISNA(RANK(A1,A$1:A$100)),"",RANK(A1,A$1:A$100) )

When you've ranked numbers you can do a data sort to get then in the order
you want.

Mike

"Jock" wrote:

Once I have 'ranked' the rows by a 'priority' number, how can I automatically
get rows with priority 1 to move to the top of the sheet followed by priority
2 and so on?
Also, how can I get rid of the #N/A error (still in RANK) in cells reporting
on incomplete data?
--
tia

Jock

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 440
Default Rank

Got around it by having a button/macro.
I have been trying to code cell shading to red if priority '1', then orange
for "2" and finally green for '3'. I can't get it to work.
Any ideas?
--
tia

Jock


"Mike H" wrote:

Jock,

I'm not aware of any worksheet function to do this but you could monitor A25
with the worksheet change event and if a 1 is enter call a macto:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Target.Address = "$A$25" Then
If Target.Value = 1 Then
MsgBox ("You put a 1 in A25")
'< delete the msgbox bit and record
' yourself doing your sort and paste it here
End If
End If
End Sub

Mike

"Jock" wrote:

Thanks Mike. Error sorted, although it ranked in decending order. Fixed it
though.
Rather than manually sort, can I automate the sorting so that for example,
when I prioritise something to '1' it moves from row 25 (or whatever) to row
1 an soon as '1' is entered in A25?
--
tia

Jock


"Mike H" wrote:

Jock,

You can avoid the NA error with:-

=IF(ISNA(RANK(A1,A$1:A$100)),"",RANK(A1,A$1:A$100) )

When you've ranked numbers you can do a data sort to get then in the order
you want.

Mike

"Jock" wrote:

Once I have 'ranked' the rows by a 'priority' number, how can I automatically
get rows with priority 1 to move to the top of the sheet followed by priority
2 and so on?
Also, how can I get rid of the #N/A error (still in RANK) in cells reporting
on incomplete data?
--
tia

Jock



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Rank

Jock,

I'd do that with conditional formatting but if you want a macro try:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Select Case Target.Value
Case 1
icolour = 3
Case 2
icolour = 44
Case 3
icolour = 4
End Select
Target.Interior.ColorIndex = icolour
End If
End Sub

"Jock" wrote:

Got around it by having a button/macro.
I have been trying to code cell shading to red if priority '1', then orange
for "2" and finally green for '3'. I can't get it to work.
Any ideas?
--
tia

Jock


"Mike H" wrote:

Jock,

I'm not aware of any worksheet function to do this but you could monitor A25
with the worksheet change event and if a 1 is enter call a macto:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Target.Address = "$A$25" Then
If Target.Value = 1 Then
MsgBox ("You put a 1 in A25")
'< delete the msgbox bit and record
' yourself doing your sort and paste it here
End If
End If
End Sub

Mike

"Jock" wrote:

Thanks Mike. Error sorted, although it ranked in decending order. Fixed it
though.
Rather than manually sort, can I automate the sorting so that for example,
when I prioritise something to '1' it moves from row 25 (or whatever) to row
1 an soon as '1' is entered in A25?
--
tia

Jock


"Mike H" wrote:

Jock,

You can avoid the NA error with:-

=IF(ISNA(RANK(A1,A$1:A$100)),"",RANK(A1,A$1:A$100) )

When you've ranked numbers you can do a data sort to get then in the order
you want.

Mike

"Jock" wrote:

Once I have 'ranked' the rows by a 'priority' number, how can I automatically
get rows with priority 1 to move to the top of the sheet followed by priority
2 and so on?
Also, how can I get rid of the #N/A error (still in RANK) in cells reporting
on incomplete data?
--
tia

Jock

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 440
Default Rank

Great Mike, thanks.
I would like the entire row coloured though and I have tried to incorporate
this line:
Set myRow = Target.Offset(0, -2).Resize(, 5)
but it has no effect. Can you tell me where this would go?

Thanks again,

Jock


"Mike H" wrote:

Jock,

I'd do that with conditional formatting but if you want a macro try:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Select Case Target.Value
Case 1
icolour = 3
Case 2
icolour = 44
Case 3
icolour = 4
End Select
Target.Interior.ColorIndex = icolour
End If
End Sub

"Jock" wrote:

Got around it by having a button/macro.
I have been trying to code cell shading to red if priority '1', then orange
for "2" and finally green for '3'. I can't get it to work.
Any ideas?
--
tia

Jock


"Mike H" wrote:

Jock,

I'm not aware of any worksheet function to do this but you could monitor A25
with the worksheet change event and if a 1 is enter call a macto:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Target.Address = "$A$25" Then
If Target.Value = 1 Then
MsgBox ("You put a 1 in A25")
'< delete the msgbox bit and record
' yourself doing your sort and paste it here
End If
End If
End Sub

Mike

"Jock" wrote:

Thanks Mike. Error sorted, although it ranked in decending order. Fixed it
though.
Rather than manually sort, can I automate the sorting so that for example,
when I prioritise something to '1' it moves from row 25 (or whatever) to row
1 an soon as '1' is entered in A25?
--
tia

Jock


"Mike H" wrote:

Jock,

You can avoid the NA error with:-

=IF(ISNA(RANK(A1,A$1:A$100)),"",RANK(A1,A$1:A$100) )

When you've ranked numbers you can do a data sort to get then in the order
you want.

Mike

"Jock" wrote:

Once I have 'ranked' the rows by a 'priority' number, how can I automatically
get rows with priority 1 to move to the top of the sheet followed by priority
2 and so on?
Also, how can I get rid of the #N/A error (still in RANK) in cells reporting
on incomplete data?
--
tia

Jock

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Rank

It's not nearly that complicated, just change this line in the macro to get
the entire row shaded.

Target.EntireRow.Interior.ColorIndex = icolour

Mike

"Jock" wrote:

Great Mike, thanks.
I would like the entire row coloured though and I have tried to incorporate
this line:
Set myRow = Target.Offset(0, -2).Resize(, 5)
but it has no effect. Can you tell me where this would go?

Thanks again,

Jock


"Mike H" wrote:

Jock,

I'd do that with conditional formatting but if you want a macro try:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Select Case Target.Value
Case 1
icolour = 3
Case 2
icolour = 44
Case 3
icolour = 4
End Select
Target.Interior.ColorIndex = icolour
End If
End Sub

"Jock" wrote:

Got around it by having a button/macro.
I have been trying to code cell shading to red if priority '1', then orange
for "2" and finally green for '3'. I can't get it to work.
Any ideas?
--
tia

Jock


"Mike H" wrote:

Jock,

I'm not aware of any worksheet function to do this but you could monitor A25
with the worksheet change event and if a 1 is enter call a macto:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Target.Address = "$A$25" Then
If Target.Value = 1 Then
MsgBox ("You put a 1 in A25")
'< delete the msgbox bit and record
' yourself doing your sort and paste it here
End If
End If
End Sub

Mike

"Jock" wrote:

Thanks Mike. Error sorted, although it ranked in decending order. Fixed it
though.
Rather than manually sort, can I automate the sorting so that for example,
when I prioritise something to '1' it moves from row 25 (or whatever) to row
1 an soon as '1' is entered in A25?
--
tia

Jock


"Mike H" wrote:

Jock,

You can avoid the NA error with:-

=IF(ISNA(RANK(A1,A$1:A$100)),"",RANK(A1,A$1:A$100) )

When you've ranked numbers you can do a data sort to get then in the order
you want.

Mike

"Jock" wrote:

Once I have 'ranked' the rows by a 'priority' number, how can I automatically
get rows with priority 1 to move to the top of the sheet followed by priority
2 and so on?
Also, how can I get rid of the #N/A error (still in RANK) in cells reporting
on incomplete data?
--
tia

Jock

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 440
Default Rank

How easy is that!!
Great...however can it be stopped at, say column Z??
If it's not do-able, I can live with it.

Thanks for your help Mike, really appreciated

Jock


"Mike H" wrote:

It's not nearly that complicated, just change this line in the macro to get
the entire row shaded.

Target.EntireRow.Interior.ColorIndex = icolour

Mike

"Jock" wrote:

Great Mike, thanks.
I would like the entire row coloured though and I have tried to incorporate
this line:
Set myRow = Target.Offset(0, -2).Resize(, 5)
but it has no effect. Can you tell me where this would go?

Thanks again,

Jock


"Mike H" wrote:

Jock,

I'd do that with conditional formatting but if you want a macro try:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Select Case Target.Value
Case 1
icolour = 3
Case 2
icolour = 44
Case 3
icolour = 4
End Select
Target.Interior.ColorIndex = icolour
End If
End Sub

"Jock" wrote:

Got around it by having a button/macro.
I have been trying to code cell shading to red if priority '1', then orange
for "2" and finally green for '3'. I can't get it to work.
Any ideas?
--
tia

Jock


"Mike H" wrote:

Jock,

I'm not aware of any worksheet function to do this but you could monitor A25
with the worksheet change event and if a 1 is enter call a macto:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Target.Address = "$A$25" Then
If Target.Value = 1 Then
MsgBox ("You put a 1 in A25")
'< delete the msgbox bit and record
' yourself doing your sort and paste it here
End If
End If
End Sub

Mike

"Jock" wrote:

Thanks Mike. Error sorted, although it ranked in decending order. Fixed it
though.
Rather than manually sort, can I automate the sorting so that for example,
when I prioritise something to '1' it moves from row 25 (or whatever) to row
1 an soon as '1' is entered in A25?
--
tia

Jock


"Mike H" wrote:

Jock,

You can avoid the NA error with:-

=IF(ISNA(RANK(A1,A$1:A$100)),"",RANK(A1,A$1:A$100) )

When you've ranked numbers you can do a data sort to get then in the order
you want.

Mike

"Jock" wrote:

Once I have 'ranked' the rows by a 'priority' number, how can I automatically
get rows with priority 1 to move to the top of the sheet followed by priority
2 and so on?
Also, how can I get rid of the #N/A error (still in RANK) in cells reporting
on incomplete data?
--
tia

Jock

  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Rank

Mike

This change to the macro shaeds up to column Z

Range(Target, Target.Offset(0, 25)).Interior.ColorIndex = icolour

Mike

"Jock" wrote:

How easy is that!!
Great...however can it be stopped at, say column Z??
If it's not do-able, I can live with it.

Thanks for your help Mike, really appreciated

Jock


"Mike H" wrote:

It's not nearly that complicated, just change this line in the macro to get
the entire row shaded.

Target.EntireRow.Interior.ColorIndex = icolour

Mike

"Jock" wrote:

Great Mike, thanks.
I would like the entire row coloured though and I have tried to incorporate
this line:
Set myRow = Target.Offset(0, -2).Resize(, 5)
but it has no effect. Can you tell me where this would go?

Thanks again,

Jock


"Mike H" wrote:

Jock,

I'd do that with conditional formatting but if you want a macro try:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Select Case Target.Value
Case 1
icolour = 3
Case 2
icolour = 44
Case 3
icolour = 4
End Select
Target.Interior.ColorIndex = icolour
End If
End Sub

"Jock" wrote:

Got around it by having a button/macro.
I have been trying to code cell shading to red if priority '1', then orange
for "2" and finally green for '3'. I can't get it to work.
Any ideas?
--
tia

Jock


"Mike H" wrote:

Jock,

I'm not aware of any worksheet function to do this but you could monitor A25
with the worksheet change event and if a 1 is enter call a macto:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Target.Address = "$A$25" Then
If Target.Value = 1 Then
MsgBox ("You put a 1 in A25")
'< delete the msgbox bit and record
' yourself doing your sort and paste it here
End If
End If
End Sub

Mike

"Jock" wrote:

Thanks Mike. Error sorted, although it ranked in decending order. Fixed it
though.
Rather than manually sort, can I automate the sorting so that for example,
when I prioritise something to '1' it moves from row 25 (or whatever) to row
1 an soon as '1' is entered in A25?
--
tia

Jock


"Mike H" wrote:

Jock,

You can avoid the NA error with:-

=IF(ISNA(RANK(A1,A$1:A$100)),"",RANK(A1,A$1:A$100) )

When you've ranked numbers you can do a data sort to get then in the order
you want.

Mike

"Jock" wrote:

Once I have 'ranked' the rows by a 'priority' number, how can I automatically
get rows with priority 1 to move to the top of the sheet followed by priority
2 and so on?
Also, how can I get rid of the #N/A error (still in RANK) in cells reporting
on incomplete data?
--
tia

Jock



  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 440
Default Rank

Fixed.
Thank you Mike

Jock


"Mike H" wrote:

Mike

This change to the macro shaeds up to column Z

Range(Target, Target.Offset(0, 25)).Interior.ColorIndex = icolour

Mike

"Jock" wrote:

How easy is that!!
Great...however can it be stopped at, say column Z??
If it's not do-able, I can live with it.

Thanks for your help Mike, really appreciated

Jock


"Mike H" wrote:

It's not nearly that complicated, just change this line in the macro to get
the entire row shaded.

Target.EntireRow.Interior.ColorIndex = icolour

Mike

"Jock" wrote:

Great Mike, thanks.
I would like the entire row coloured though and I have tried to incorporate
this line:
Set myRow = Target.Offset(0, -2).Resize(, 5)
but it has no effect. Can you tell me where this would go?

Thanks again,

Jock


"Mike H" wrote:

Jock,

I'd do that with conditional formatting but if you want a macro try:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Select Case Target.Value
Case 1
icolour = 3
Case 2
icolour = 44
Case 3
icolour = 4
End Select
Target.Interior.ColorIndex = icolour
End If
End Sub

"Jock" wrote:

Got around it by having a button/macro.
I have been trying to code cell shading to red if priority '1', then orange
for "2" and finally green for '3'. I can't get it to work.
Any ideas?
--
tia

Jock


"Mike H" wrote:

Jock,

I'm not aware of any worksheet function to do this but you could monitor A25
with the worksheet change event and if a 1 is enter call a macto:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Target.Address = "$A$25" Then
If Target.Value = 1 Then
MsgBox ("You put a 1 in A25")
'< delete the msgbox bit and record
' yourself doing your sort and paste it here
End If
End If
End Sub

Mike

"Jock" wrote:

Thanks Mike. Error sorted, although it ranked in decending order. Fixed it
though.
Rather than manually sort, can I automate the sorting so that for example,
when I prioritise something to '1' it moves from row 25 (or whatever) to row
1 an soon as '1' is entered in A25?
--
tia

Jock


"Mike H" wrote:

Jock,

You can avoid the NA error with:-

=IF(ISNA(RANK(A1,A$1:A$100)),"",RANK(A1,A$1:A$100) )

When you've ranked numbers you can do a data sort to get then in the order
you want.

Mike

"Jock" wrote:

Once I have 'ranked' the rows by a 'priority' number, how can I automatically
get rows with priority 1 to move to the top of the sheet followed by priority
2 and so on?
Also, how can I get rid of the #N/A error (still in RANK) in cells reporting
on incomplete data?
--
tia

Jock

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
RANK, duplicate ranking but no gaps in rank arron laing Excel Worksheet Functions 4 June 14th 06 07:57 AM
Rank(A1,C1:C5) - Rank using 2 ranges goofy11 Excel Worksheet Functions 3 June 9th 06 06:03 AM
Rank where lowest value is highest rank mile3024 Excel Worksheet Functions 2 December 9th 05 10:57 PM
Does Correl/Rank combo work eg CORREL(cols E & H) where E&H=RANK(. Emmanuel Excel Worksheet Functions 3 November 12th 05 03:33 PM
Rank items, select one start date, have remaining dates follow based on rank rob normerica Excel Discussion (Misc queries) 1 August 15th 05 09:36 PM


All times are GMT +1. The time now is 01:56 PM.

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"