Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
RANK, duplicate ranking but no gaps in rank | Excel Worksheet Functions | |||
Rank(A1,C1:C5) - Rank using 2 ranges | Excel Worksheet Functions | |||
Rank where lowest value is highest rank | Excel Worksheet Functions | |||
Does Correl/Rank combo work eg CORREL(cols E & H) where E&H=RANK(. | Excel Worksheet Functions | |||
Rank items, select one start date, have remaining dates follow based on rank | Excel Discussion (Misc queries) |