gtd526
Well-known Member
- Joined
- Jul 30, 2013
- Messages
- 684
- Office Version
- 2019
- Platform
- Windows
Hello,
I'm able to select rows where E:E >= 70%, and F:F >= 10.
How can I insert the selection to the top of range? (ie Row 3)
Then the next move will be under the 1st move. 2nd under 1st, 3rd under 2nd, 4th under 3rd, etc until there are no more selections.
Here is the code for making the selections. Below the code is the worksheet.
I'm able to select rows where E:E >= 70%, and F:F >= 10.
How can I insert the selection to the top of range? (ie Row 3)
Then the next move will be under the 1st move. 2nd under 1st, 3rd under 2nd, 4th under 3rd, etc until there are no more selections.
Here is the code for making the selections. Below the code is the worksheet.
VBA Code:
Sub test()
'works
'select row if cells in 2 different columns meet criteria
Dim i As Long
Dim n As Long
n = Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Row
For i = 3 To n
With Sheets("Sheet2")
If Cells(i, 5) >= 0.7 And Cells(i, 6).Value >= 10 Then
Cells(i, 5).Rows().EntireRow.Select 'Cut
MsgBox "its selected"
End If
End With
Next i
MsgBox "Your Done"
End Sub
NBA.xlsm | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | Row 4 | Row 5 | 0.7 | 10 | ||||
2 | As FAV | As FAV | Rank | Criteria2 | Criteria2 Percentage | Count | ||
3 | IF(AND($A4=$AQ4,$B4<0,$K4<=$K5,ISNUMBER($Q4),($Q4>=0.55),ISNUMBER($R4),($R4>0),ISNUMBER($S4),($S4>0),$AR4=TRUE,$AW4<=$AW$1,$Q4>=.55,ISNA(MATCH($A4,$H$52:$H$66,0)),ISNUMBER($R4),($R4>0),$R4>$R5,ISNUMBER($S4),($S4>0),$S4>$S5,ISNUMBER($AL4),($AL4>=.6),ISNUMBER($AM4),($AM4>=.6)),"R, S, T>0, AL:AM>=60%" | IF(AND($A5=$AQ5,$B5<0,$K4>=$K5,ISNUMBER($Q5),($Q5>=0.55),ISNUMBER($R5),($R5>0),ISNUMBER($S5),($S5>0),$AR5=TRUE,$AW5<=$AW$1,$Q5>=.55,ISNA(MATCH($A5,$H$52:$H$66,0)),ISNUMBER($R5),($R5>0),$R4<$R5,ISNUMBER($S5),($S5>0),$S4<$S5,ISNUMBER($AL5),($AL5>=.6),ISNUMBER($AM5),($AM5>=.6)),"R, S, T>0, AL:AM>=60%" | 1 | R, S, T>0, AL:AM>=60% | 100.0% | 2 | ||
4 | ,IF(AND($A4=$AQ4,$B4<0,$K4<=$K5,ISNUMBER($Q4),($Q4>=0.55),ISNUMBER($R4),($R4>0),ISNUMBER($S4),($S4>0),$AR4=TRUE,$AW4<=$AW$1,$Q4>=.55,ISNA(MATCH($A4,$H$52:$H$66,0)),$Q4>=$Q5,$S4>=$S5,ISNUMBER($T4),($T4>0),ISNUMBER($AL4),($AL4>=.6),ISNUMBER($AM4),($AM4>=.6)),"Q, S, T>0, AL:AM>=60%" | ,IF(AND($A5=$AQ5,$B5<0,$K4>=$K5,ISNUMBER($Q5),($Q5>=0.55),ISNUMBER($R5),($R5>0),ISNUMBER($S5),($S5>0),$AR5=TRUE,$AW5<=$AW$1,$Q5>=.55,ISNA(MATCH($A5,$H$52:$H$66,0)),$Q4<=$Q5,$S4<=$S5,ISNUMBER($T5),($T5>0),ISNUMBER($AL5),($AL5>=.6),ISNUMBER($AM5),($AM5>=.6)),"Q, S, T>0, AL:AM>=60%" | 1 | Q, S, T>0, AL:AM>=60% | 100.0% | 4 | ||
5 | ,IF(AND($A4=$AQ4,$B4<0,$K4<=$K5,ISNUMBER($Q4),($Q4>=0.55),ISNUMBER($R4),($R4>0),ISNUMBER($S4),($S4>0),$AR4=TRUE,$AW4<=$AW$1,$Q4>=.55,ISNA(MATCH($A4,$H$52:$H$66,0)),$Q4>=$Q5,ISNUMBER($T4),($T4>0),ISNUMBER($AL4),($AL4>=.6),ISNUMBER($AM4),($AM4>=.6)),"Q, T>0, AL:AM>=60%" | ,IF(AND($A5=$AQ5,$B5<0,$K4>=$K5,ISNUMBER($Q5),($Q5>=0.55),ISNUMBER($R5),($R5>0),ISNUMBER($S5),($S5>0),$AR5=TRUE,$AW5<=$AW$1,$Q5>=.55,ISNA(MATCH($A5,$H$52:$H$66,0)),$Q4<=$Q5,ISNUMBER($T5),($T5>0),ISNUMBER($AL5),($AL5>=.6),ISNUMBER($AM5),($AM5>=.6)),"Q, T>0, AL:AM>=60%" | 1 | Q, T>0, AL:AM>=60% | 100.0% | 2 | ||
6 | ,IF(AND($A4=$AQ4,$B4<0,$K4<=$K5,ISNUMBER($Q4),($Q4>=0.55),ISNUMBER($R4),($R4>0),ISNUMBER($S4),($S4>0),$AR4=TRUE,$AW4<=$AW$1,$Q4>=.55,ISNA(MATCH($A4,$H$52:$H$66,0)),$AM4>=$AM5),"Tovers (AD)" | ,IF(AND($A5=$AQ5,$B5<0,$K4>=$K5,ISNUMBER($Q5),($Q5>=0.55),ISNUMBER($R5),($R5>0),ISNUMBER($S5),($S5>0),$AR5=TRUE,$AW5<=$AW$1,$Q5>=.55,ISNA(MATCH($A5,$H$52:$H$66,0)),$AM4<=$AM5),"Tovers (AD)" | 1 | Tovers (AD) | 100.0% | 4 | ||
7 | ,IF(AND($A4=$AQ4,$B4<0,$K4<=$K5,ISNUMBER($Q4),($Q4>=0.55),ISNUMBER($R4),($R4>0),ISNUMBER($S4),($S4>0),$AR4=TRUE,$AW4<=$AW$1,$Q4>=.55,ISNA(MATCH($A4,$H$52:$H$66,0)),$Q4>=$Q5,$R4>=$R5,ISNUMBER($T4),($T4>0),ISNUMBER($AL4),($AL4>=.6),ISNUMBER($AM4),($AM4>=.6)),"Q, R, T>0, AL:AM>=60%" | ,IF(AND($A5=$AQ5,$B5<0,$K4>=$K5,ISNUMBER($Q5),($Q5>=0.55),ISNUMBER($R5),($R5>0),ISNUMBER($S5),($S5>0),$AR5=TRUE,$AW5<=$AW$1,$Q5>=.55,ISNA(MATCH($A5,$H$52:$H$66,0)),$Q4<=$Q5,$R4<=$R5,ISNUMBER($T5),($T5>0),ISNUMBER($AL5),($AL5>=.6),ISNUMBER($AM5),($AM5>=.6)),"Q, R, T>0, AL:AM>=60%" | 1 | Q, R, T>0, AL:AM>=60% | 100.0% | 1 | ||
8 | ,IF(AND($A4=$AQ4,$B4<0,$K4<=$K5,ISNUMBER($Q4),($Q4>=0.55),ISNUMBER($R4),($R4>0),ISNUMBER($S4),($S4>0),$AR4=TRUE,$AW4<=$AW$1,$Q4>=.55,ISNA(MATCH($A4,$H$52:$H$66,0)),ISNUMBER($Q4),($Q4>0),$Q4>$Q5,ISNUMBER($R4),($R4>0),$R4>$R5,ISNUMBER($AL4),($AL4>=.6),ISNUMBER($AM4),($AM4>=.6)),"Q, R, AL:AM>=60%" | ,IF(AND($A5=$AQ5,$B5<0,$K4>=$K5,ISNUMBER($Q5),($Q5>=0.55),ISNUMBER($R5),($R5>0),ISNUMBER($S5),($S5>0),$AR5=TRUE,$AW5<=$AW$1,$Q5>=.55,ISNA(MATCH($A5,$H$52:$H$66,0)),ISNUMBER($Q5),($Q5>0),$Q4<$Q5,ISNUMBER($R5),($R5>0),$R4<$R5,ISNUMBER($AL5),($AL5>=.6),ISNUMBER($AM5),($AM5>=.6)),"Q, R, AL:AM>=60%" | 6 | Q, R, AL:AM>=60% | 77.3% | 22 | ||
9 | ,IF(AND($A4=$AQ4,$B4<0,$K4<=$K5,ISNUMBER($Q4),($Q4>=0.55),ISNUMBER($R4),($R4>0),ISNUMBER($S4),($S4>0),$AR4=TRUE,$AW4<=$AW$1,$Q4>=.55,ISNA(MATCH($A4,$H$52:$H$66,0)),$Q4>=$Q5,$S4>=$S5,ISNUMBER($AL4),($AL4>=.6),ISNUMBER($AM4),($AM4>=.6)),"Q, S, AL:AM>=60%" | ,IF(AND($A5=$AQ5,$B5<0,$K4>=$K5,ISNUMBER($Q5),($Q5>=0.55),ISNUMBER($R5),($R5>0),ISNUMBER($S5),($S5>0),$AR5=TRUE,$AW5<=$AW$1,$Q5>=.55,ISNA(MATCH($A5,$H$52:$H$66,0)),$Q4<=$Q5,$S4<=$S5,ISNUMBER($AL5),($AL5>=.6),ISNUMBER($AM5),($AM5>=.6)),"Q, S, AL:AM>=60%" | 6 | Q, S, AL:AM>=60% | 77.3% | 22 | ||
10 | ,IF(AND($A4=$AQ4,$B4<0,$K4<=$K5,ISNUMBER($Q4),($Q4>=0.55),ISNUMBER($R4),($R4>0),ISNUMBER($S4),($S4>0),$AR4=TRUE,$AW4<=$AW$1,$Q4>=.55,ISNA(MATCH($A4,$H$52:$H$66,0)),ISNUMBER($AL4),($AL4>=.6),ISNUMBER($AM4),($AM4>=.6)),"Rank2, AL:AM>=60%" | ,IF(AND($A5=$AQ5,$B5<0,$K4>=$K5,ISNUMBER($Q5),($Q5>=0.55),ISNUMBER($R5),($R5>0),ISNUMBER($S5),($S5>0),$AR5=TRUE,$AW5<=$AW$1,$Q5>=.55,ISNA(MATCH($A5,$H$52:$H$66,0)),ISNUMBER($AL5),($AL5>=.6),ISNUMBER($AM5),($AM5>=.6)),"Rank2, AL:AM>=60%" | 8 | Rank2, AL:AM>=60% | 76.5% | 51 | ||
11 | ,IF(AND($A4=$AQ4,$B4<0,$K4<=$K5,ISNUMBER($Q4),($Q4>=0.55),ISNUMBER($R4),($R4>0),ISNUMBER($S4),($S4>0),$AR4=TRUE,$AW4<=$AW$1,$Q4>=.55,ISNA(MATCH($A4,$H$52:$H$66,0)),$Q4>$Q5,$R4>0,$R4>$R5,$S4>0,$S4>$S5,ISNUMBER($AL4),($AL4>=.6),ISNUMBER($AM4),($AM4>=.6)),"Q, R, S, AL:AM>=60%" | ,IF(AND($A5=$AQ5,$B5<0,$K4>=$K5,ISNUMBER($Q5),($Q5>=0.55),ISNUMBER($R5),($R5>0),ISNUMBER($S5),($S5>0),$AR5=TRUE,$AW5<=$AW$1,$Q5>=.55,ISNA(MATCH($A5,$H$52:$H$66,0)),$Q4<$Q5,$R5>0,$R4<$R5,$S5>0,$S4<$S5,ISNUMBER($AL5),($AL5>=.6),ISNUMBER($AM5),($AM5>=.6)),"Q, R, S, AL:AM>=60%" | 9 | Q, R, S, AL:AM>=60% | 76.0% | 25 | ||
12 | ,IF(AND($A4=$AQ4,$B4<0,$K4<=$K5,ISNUMBER($Q4),($Q4>=0.55),ISNUMBER($R4),($R4>0),ISNUMBER($S4),($S4>0),$AR4=TRUE,$AW4<=$AW$1,$Q4>=.55,ISNA(MATCH($A4,$H$52:$H$66,0)),$M4>=$M5,ISNUMBER($N4),($N4>0),$Q4>=$Q5,ISNUMBER($R4),($R4>0),ISNUMBER($AL4),($AL4>=.6),ISNUMBER($AM4),($AM4>=.6)),"M,N>0,Q,R>0,AL:AM>=60%" | ,IF(AND($A5=$AQ5,$B5<0,$K4>=$K5,ISNUMBER($Q5),($Q5>=0.55),ISNUMBER($R5),($R5>0),ISNUMBER($S5),($S5>0),$AR5=TRUE,$AW5<=$AW$1,$Q5>=.55,ISNA(MATCH($A5,$H$52:$H$66,0)),$M4<=$M5,ISNUMBER($N5),($N5>0),$Q4<=$Q5,ISNUMBER($R5),($R5>0),ISNUMBER($AL5),($AL5>=.6),ISNUMBER($AM5),($AM5>=.6)),"M,N>0,Q,R>0,AL:AM>=60%" | 10 | M,N>0,Q,R>0,AL:AM>=60% | 75.0% | 8 | ||
13 | ,IF(AND($A4=$AQ4,$B4<0,$K4<=$K5,ISNUMBER($Q4),($Q4>=0.55),ISNUMBER($R4),($R4>0),ISNUMBER($S4),($S4>0),$AR4=TRUE,$AW4<=$AW$1,$Q4>=.55,ISNA(MATCH($A4,$H$52:$H$66,0)),$Q4>=$Q5,$R4>=$R5,$S4>=$S5,ISNUMBER($T4),($T4>0),ISNUMBER($AL4),($AL4>=.6),ISNUMBER($AM4),($AM4>=.6)),"Q, R, S, T>0, AL:AM>=60%" | ,IF(AND($A5=$AQ5,$B5<0,$K4>=$K5,ISNUMBER($Q5),($Q5>=0.55),ISNUMBER($R5),($R5>0),ISNUMBER($S5),($S5>0),$AR5=TRUE,$AW5<=$AW$1,$Q5>=.55,ISNA(MATCH($A5,$H$52:$H$66,0)),$Q4<=$Q5,$R4<=$R5,$S4<=$S5,ISNUMBER($T5),($T5>0),ISNUMBER($AL5),($AL5>=.6),ISNUMBER($AM5),($AM5>=.6)),"Q, R, S, T>0, AL:AM>=60%" | 11 | Q, R, S, T>0, AL:AM>=60% | 71.4% | 7 | ||
14 | ,IF(AND($A4=$AQ4,$B4<0,$K4<=$K5,ISNUMBER($Q4),($Q4>=0.55),ISNUMBER($R4),($R4>0),ISNUMBER($S4),($S4>0),$AR4=TRUE,$AW4<=$AW$1,$Q4>=.55,ISNA(MATCH($A4,$H$52:$H$66,0)),$AH4>=$AH5),"EPR (AG)" | ,IF(AND($A5=$AQ5,$B5<0,$K4>=$K5,ISNUMBER($Q5),($Q5>=0.55),ISNUMBER($R5),($R5>0),ISNUMBER($S5),($S5>0),$AR5=TRUE,$AW5<=$AW$1,$Q5>=.55,ISNA(MATCH($A5,$H$52:$H$66,0)),$AH4<=$AH5),"EPR (AG)" | 11 | EPR (AG) | 71.4% | 7 | ||
15 | ,IF(AND($A4=$AQ4,$B4<0,$K4<=$K5,ISNUMBER($Q4),($Q4>=0.55),ISNUMBER($R4),($R4>0),ISNUMBER($S4),($S4>0),$AR4=TRUE,$AW4<=$AW$1,$Q4>=.55,ISNA(MATCH($A4,$H$52:$H$66,0)),$O4>=$O5,ISNUMBER($AL4),($AL4>=.6),ISNUMBER($AM4),($AM4>=.6)),"MOV, AL:AM>=60%" | ,IF(AND($A5=$AQ5,$B5<0,$K4>=$K5,ISNUMBER($Q5),($Q5>=0.55),ISNUMBER($R5),($R5>0),ISNUMBER($S5),($S5>0),$AR5=TRUE,$AW5<=$AW$1,$Q5>=.55,ISNA(MATCH($A5,$H$52:$H$66,0)),$O4<=$O5,ISNUMBER($AL5),($AL5>=.6),ISNUMBER($AM5),($AM5>=.6)),"MOV, AL:AM>=60%" | 13 | MOV, AL:AM>=60% | 71.2% | 52 | ||
16 | ,IF(AND($A4=$AQ4,$B4<0,$B4=100),"????",""))))))))))))))))))))))))))) | ,IF(AND($A4=$AQ4,$B4<0,$B4=100),"????",""))))))))))))))))))))))))))) | #VALUE! | ???? | ||||
Indicators |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C3:C16 | C3 | =RANK(E3,Rank) |
D3:D16 | D3 | =MID($A3,FIND("""",$A3)+1,FIND("""",$A3,FIND("""",$A3)+1)-FIND("""",$A3)-1) |
E3:E16 | E3 | =IF($D3="????","",IF($D3="Rank2, AL:AM>=60%",Favs!$AH$55,IF($D3="MOV, AL:AM>=60%",Favs!$AB$67,IF($D3="MOV2, AL:AM>=60%",Favs!$AE$67,IF($D3="MOV,MOV2,AL:AM>=60%",Favs!$AH$67,IF($D3="M,N>0,Q,R>0,AL:AM>=60%",Favs!$Y$79,IF($D3="EPR (AG)",Favs!$M$91,IF($D3="MOV2 > ATS",Favs!$V$79,IF($D3="Tovers (AE)",Favs!$V$91,IF($D3="Steals (AE)",Favs!$Y$91,IF($D3="Rank2, AL>=60%",Favs!$AB$55,IF($D3="Fouls (AF)",Favs!$AB$91,IF($D3="Adj Off. (AH)",Favs!$AE$91,IF($D3="Adj Def. (AI)",Favs!$AH$91,IF($D3="Pts in Paint (AJ)",Favs!$P$91,IF($D3="MOV2, AL:AM>=60%",Favs!$M$103,IF($D3="M,N>0,Q,R>0,AL:AM>=60%",Favs!$Y$79,IF($D3="Pts in Paint (AJ)",Favs!$V$55,IF($D3="Q, R, S, AL:AM>=60%",Favs!$P$43,IF($D3="Poss/G (AC)",Favs!$S$91,IF($D3="Tovers (AM)",Favs!$V$91,IF($D3="Adj Off. (AQ)",Favs!$AE$91,IF($D3="Adj Def. (AR)",Favs!$AH$91,IF($D3="ToverS (AD)",Favs!$V$91,IF($D3="Q, R, S, T>0, AL:AM>=60%",Favs!$M$43,IF($D3="Q, R, T>0, AL:AM>=60%",Favs!$S$43,IF($D3="Q, S, T>0, AL:AM>=60%",Favs!$Y$43,IF($D3="R, S, T>0, AL:AM>=60%",Favs!$Y$43,IF($D3="Q, R, AL:AM>=60%",Favs!$P$55,IF($D3="Q, S, AL:AM>=60%",Favs!$S$55,IF($D3="Q, T>0, AL:AM>=60%",Favs!$M$67,""))))))))))))))))))))))))))))))) |
F3 | F3 | =Favs!$Y$48 |
F4 | F4 | =Favs!$V$48 |
F5 | F5 | =Favs!$M$72 |
F6 | F6 | =Favs!$V$96 |
F7 | F7 | =Favs!$S$48 |
F8 | F8 | =Favs!$P$60 |
F9 | F9 | =Favs!$S$60 |
F10 | F10 | =Favs!$AH$60 |
F11 | F11 | =Favs!$P$48 |
F12 | F12 | =Favs!$Y$84 |
F13 | F13 | =Favs!$M$48 |
F14 | F14 | =Favs!$M$96 |
F15 | F15 | =Favs!$AB$72 |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
C3:F34 | Expression | =AND($E3>=0.7,$F3>=10,$E3<>"") | text | NO |
D3:D34 | Cell Value | duplicates | text | NO |
D3:D34,L15:L64 | Cell Value | duplicates | text | NO |