bluefeather8989
Active Member
- Joined
- Nov 20, 2009
- Messages
- 325
- Office Version
- 365
- Platform
- Windows
In cells R14:R20 I have numbers from 0-6. each number will show based on a formula. in cell N4 is a number from 0-6 inserted by vba. what I need is VBA to search the range R14:R20 for the number that's in cell N4 then search next number and insert that number into N4.
Example:
if R13=1 or 2 do nothing
N4=0
the next number in the range (R14:R20) is 3. N4 value will change to 3
If N4 value is 6
the next number in the range (R14:R20) is 0. N4 value will change to 0
Example:
if R13=1 or 2 do nothing
N4=0
the next number in the range (R14:R20) is 3. N4 value will change to 3
If N4 value is 6
the next number in the range (R14:R20) is 0. N4 value will change to 0
TV Shows.xlsm | ||||||
---|---|---|---|---|---|---|
O | P | Q | R | |||
13 | 3 | |||||
14 | Monday | 2 | 2 | 0 | ||
15 | Tuesday | |||||
16 | Wednesday | |||||
17 | Thursday | 2 | 2 | 3 | ||
18 | Friday | |||||
19 | Saturday | |||||
20 | Sunday | 2 | 2 | 6 | ||
List |
Cell Formulas | ||
---|---|---|
Range | Formula | |
Q13 | Q13 | =COUNT(Q14:Q20) |
Q14 | Q14 | =IF(COUNTIF(U:U,"Monday")>1,COUNTIF(U:U,"Monday"),"0") |
R14 | R14 | =IF(P14>1,0,"") |
Q15 | Q15 | =IF(COUNTIF(U:U,"Tuesday")>1,COUNTIF(U:U,"Tuesday"),"") |
R15 | R15 | =IF(P15>1,1,"") |
Q16 | Q16 | =IF(COUNTIF(U:U,"Wednesday")>1,COUNTIF(U:U,"Wednesday"),"") |
R16 | R16 | =IF(P16>1,2,"") |
Q17 | Q17 | =IF(COUNTIF(U:U,"Thursday")>1,COUNTIF(U:U,"Thursday"),"") |
R17 | R17 | =IF(P17>1,3,"") |
Q18 | Q18 | =IF(COUNTIF(U:U,"Frinday")>1,COUNTIF(U:U,"Frinday"),"") |
R18 | R18 | =IF(P18>1,5,"") |
Q19 | Q19 | =IF(COUNTIF(U:U,"Saturday")>1,COUNTIF(U:U,"Saturday"),"") |
R19:R20 | R19 | =IF(P19>1,6,"") |
Q20 | Q20 | =IF(COUNTIF(U:U,"Sunday")>1,COUNTIF(U:U,"Sunday"),"") |