Hello everyone,
My level in vba does not allow me to find a solution to my problem, hence my request to the experts among you.
My file consists of two sheets, the "Crossing" sheet and the "New couples" sheet
Some information:
In the "L" column of the "New couples" sheet, from "L3", we find the list of Males.
In the "F" column of the "Crossing" sheet, from "F2", we find a 2nd list of the same Males.
In line number 2, of the "New couples" sheet, from cell "M2", we find the list of Females.
In the "B" column of the "Crossing" sheet, from "B2", we find a 2nd list of the same Females.
The Range ("M3:AD23") of the "New Couples" sheet is variable in row and column, its size must be determined at the beginning of the code.
This Range that I colored in green is ("M3:AD23") contains the inbreeding rates of all birds, each male in column "L" compared to each female in row number 2.
What I want to do is search for the inbreeding rate of certain birds, these birds are in the "Crossing" sheet:
females are in column "B", males are in column "F".
1. To find each female in column "B" of the "Crossing" Sheet, we will look for it in row number 2, of the "New Couples" sheet.
2. To find each male in column "F" of the "Crossing" Sheet, we will look for it in column "L", of the "New Couples" sheet.
3. The inbreeding rate is found at the intersection of each male with each female, this inbreeding rate will be copied (or Transpose) into column "I" of the "Crossing" sheet.
Let's take an example for the female and the male of the 2nd line of the "crossing" sheet:
The male is: "AET27-035/2022 M", it is in cell "L5" of the "New couples" sheet, the female is: "NIM96-010/2021 F", it is in cell "M2" of the "New couples" sheet, the inbreeding rate is equal to (2.29%), it is at the intersection of these two cells "L5" and "M2", it will therefore be copied to column "I" in the same line is the male "AET27-035/2022 M" and the female "NIM96-010/2021 F".
I remain at your disposal if necessary.
I would be very grateful to anyone who can provide a solution.
Please suggest me a solution with a code in vba because I would need to adapt it for other sheets.
Greetings.
"Crossing" sheet) :
"Crossing" sheet :
My level in vba does not allow me to find a solution to my problem, hence my request to the experts among you.
My file consists of two sheets, the "Crossing" sheet and the "New couples" sheet
Some information:
In the "L" column of the "New couples" sheet, from "L3", we find the list of Males.
In the "F" column of the "Crossing" sheet, from "F2", we find a 2nd list of the same Males.
In line number 2, of the "New couples" sheet, from cell "M2", we find the list of Females.
In the "B" column of the "Crossing" sheet, from "B2", we find a 2nd list of the same Females.
The Range ("M3:AD23") of the "New Couples" sheet is variable in row and column, its size must be determined at the beginning of the code.
This Range that I colored in green is ("M3:AD23") contains the inbreeding rates of all birds, each male in column "L" compared to each female in row number 2.
What I want to do is search for the inbreeding rate of certain birds, these birds are in the "Crossing" sheet:
females are in column "B", males are in column "F".
1. To find each female in column "B" of the "Crossing" Sheet, we will look for it in row number 2, of the "New Couples" sheet.
2. To find each male in column "F" of the "Crossing" Sheet, we will look for it in column "L", of the "New Couples" sheet.
3. The inbreeding rate is found at the intersection of each male with each female, this inbreeding rate will be copied (or Transpose) into column "I" of the "Crossing" sheet.
Let's take an example for the female and the male of the 2nd line of the "crossing" sheet:
The male is: "AET27-035/2022 M", it is in cell "L5" of the "New couples" sheet, the female is: "NIM96-010/2021 F", it is in cell "M2" of the "New couples" sheet, the inbreeding rate is equal to (2.29%), it is at the intersection of these two cells "L5" and "M2", it will therefore be copied to column "I" in the same line is the male "AET27-035/2022 M" and the female "NIM96-010/2021 F".
I remain at your disposal if necessary.
I would be very grateful to anyone who can provide a solution.
Please suggest me a solution with a code in vba because I would need to adapt it for other sheets.
Greetings.
"Crossing" sheet) :
Copier Intersection COL et Lignes .xlsm | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
1 | Cages | Femelles | Père | Mère | Mâles | Père | Mère | ||||
2 | Cage 1 | NIM96-010/2021 F | NIM96-002/2020 M | NIM96-020/2020 F | 1 | AET27-035/2022 M | NIM96-005/2021 M | AET27-068/2021 F | 2,29% | ||
3 | NIM96-010/2021 F | NIM96-020/2023 M | NIM96-011/2022 M | NIM96-020/2021 F | |||||||
4 | NIM96-010/2021 F | NIM96-008/2021 M | NIM96-002/2020 M | NIM96-020/2020 F | |||||||
5 | Cage 2 | AET27-026/2022 F | NIM96-046/2019 M | NIM96-036/2021 F | 2 | 5919-001/2023 M | 3024-058/2020 M | 3024-011/2022 F | |||
6 | AET27-026/2022 F | AET27-022/2023 M | AET27-022/2022 M | NIM96-010/2021 F | |||||||
7 | AET27-026/2022 F | AET27-036/2023 M | NIM96-024/2021 M | AET27-011/2022 F | |||||||
8 | Cage 3 | AET27-037/2022 F | NIM96-005/2021 M | AET27-068/2021 F | 3 | AET27-005/2024 M | AET27-022/2023 M | AET27-015/2023 F | |||
9 | AET27-037/2022 F | AET27-006/2024 M | AET27-022/2023 M | AET27-015/2023 F | |||||||
10 | AET27-037/2022 F | AET27-067/2024 M | 5919-001/2023 M | AET27-009/2023 F | |||||||
11 | Cage 4 | AET27-038/2022 F | NIM96-005/2021 M | AET27-068/2021 F | 4 | AET27-043/2024 M | NIM96-020/2023 M | AET27-020/2022 F | |||
12 | AET27-038/2022 F | AET27-026/2024 M | AET27-010/2021 M | AET27-019/2023 F | |||||||
13 | AET27-038/2022 F | AET27-005/2024 M | AET27-022/2023 M | AET27-015/2023 F | |||||||
14 | Cage 5 | AET27-017/2023 F | NIM96-008/2021 M | AET27-037/2022 F | 5 | AET27-017/2024 M | NIM96-020/2023 M | AET27-038/2022 F | |||
15 | AET27-017/2023 F | AET27-022/2022 M | AET27-049/2021 M | AET27-003/2021 F | |||||||
16 | AET27-017/2023 F | AET27-042/2024 M | NIM96-020/2023 M | AET27-020/2022 F | |||||||
17 | Cage 6 | AET27-023/2023 F | AET27-022/2022 M | NIM96-010/2021 F | 6 | AET27-013/2024 M | AET27-035/2022 M | AET27-055/2023 F | |||
18 | AET27-023/2023 F | AET27-016/2024 M | NIM96-020/2023 M | AET27-038/2022 F | |||||||
19 | AET27-023/2023 F | AET27-026/2024 M | AET27-010/2021 M | AET27-019/2023 F | |||||||
20 | Cage 7 | AET27-012/2024 F | AET27-033/2022 M | AET27-055/2023 F | 7 | AET27-033/2024 M | AET27-035/2022 M | AET27-026/2022 F | |||
21 | AET27-012/2024 F | AET27-055/2024 M | AET27-036/2023 M | NIM96-045/2022 F | |||||||
22 | AET27-012/2024 F | AET27-022/2022 M | AET27-049/2021 M | AET27-003/2021 F | |||||||
23 | Cage 8 | AET27-014/2024 F | AET27-035/2022 M | AET27-055/2023 F | 8 | AET27-026/2024 M | AET27-010/2021 M | AET27-019/2023 F | |||
24 | AET27-014/2024 F | AET27-043/2024 M | NIM96-020/2023 M | AET27-020/2022 F | |||||||
25 | AET27-014/2024 F | NIM96-008/2021 M | NIM96-002/2020 M | NIM96-020/2020 F | |||||||
26 | Cage 9 | AET27-019/2024 F | AET27-022/2022 M | NIM96-010/2021 F | 9 | AET27-006/2024 M | AET27-022/2023 M | AET27-015/2023 F | |||
27 | AET27-019/2024 F | AET27-009/2024 M | AET27-033/2022 M | AET27-009/2023 F | |||||||
28 | AET27-019/2024 F | AET27-033/2024 M | AET27-035/2022 M | AET27-026/2022 F | |||||||
29 | Cage 10 | AET27-023/2024 F | AET27-022/2022 M | NIM96-010/2021 F | 10 | AET27-057/2024 M | AET27-022/2022 M | NIM96-010/2021 F | |||
30 | AET27-023/2024 F | AET27-016/2024 M | NIM96-020/2023 M | AET27-038/2022 F | |||||||
31 | AET27-023/2024 F | 5919-001/2023 M | 3024-058/2020 M | 3024-011/2022 F | |||||||
32 | Cage 11 | AET27-035/2024 F | AET27-035/2022 M | AET27-026/2022 F | 11 | NIM96-020/2023 M | NIM96-011/2022 M | NIM96-020/2021 F | |||
33 | AET27-035/2024 F | AET27-022/2023 M | AET27-022/2022 M | NIM96-010/2021 F | |||||||
34 | AET27-035/2024 F | NIM96-008/2021 M | NIM96-002/2020 M | NIM96-020/2020 F | |||||||
35 | Cage 12 | AET27-036/2024 F | AET27-035/2022 M | AET27-026/2022 F | 12 | AET27-036/2023 M | NIM96-024/2021 M | AET27-011/2022 F | |||
36 | AET27-036/2024 F | AET27-017/2024 M | NIM96-020/2023 M | AET27-038/2022 F | |||||||
37 | AET27-036/2024 F | AET27-035/2022 M | NIM96-005/2021 M | AET27-068/2021 F | |||||||
38 | Cage 13 | AET27-044/2024 F | NIM96-020/2023 M | AET27-020/2022 F | 13 | AET27-022/2022 M | AET27-049/2021 M | AET27-003/2021 F | |||
39 | AET27-044/2024 F | AET27-036/2023 M | NIM96-024/2021 M | AET27-011/2022 F | |||||||
40 | AET27-044/2024 F | AET27-005/2024 M | AET27-022/2023 M | AET27-015/2023 F | |||||||
41 | Cage 14 | AET27-046/2024 F | AET27-022/2022 M | AET27-017/2023 F | 14 | AET27-043/2024 M | NIM96-020/2023 M | AET27-020/2022 F | |||
42 | AET27-046/2024 F | NIM96-020/2023 M | NIM96-011/2022 M | NIM96-020/2021 F | |||||||
43 | AET27-046/2024 F | AET27-036/2023 M | NIM96-024/2021 M | AET27-011/2022 F | |||||||
44 | Cage 15 | AET27-047/2024 F | AET27-022/2022 M | AET27-017/2023 F | 15 | AET27-033/2024 M | AET27-035/2022 M | AET27-026/2022 F | |||
45 | AET27-047/2024 F | AET27-016/2024 M | NIM96-020/2023 M | AET27-038/2022 F | |||||||
46 | AET27-047/2024 F | AET27-026/2024 M | AET27-010/2021 M | AET27-019/2023 F | |||||||
47 | Cage 16 | AET27-060/2024 F | NIM96-020/2023 M | AET27-023/2023 F | 16 | AET27-006/2024 M | AET27-022/2023 M | AET27-015/2023 F | |||
48 | AET27-060/2024 F | AET27-007/2024 M | 5919-001/2023 M | AET27-023/2023 F | |||||||
49 | AET27-060/2024 F | AET27-022/2023 M | AET27-022/2022 M | NIM96-010/2021 F | |||||||
50 | Cage 17 | AET27-078/23-2024 F | AET27-022/2022 M | AET27-026/2022 F | 17 | AET27-033/2024 M | AET27-035/2022 M | AET27-026/2022 F | |||
51 | AET27-078/23-2024 F | AET27-006/2024 M | AET27-022/2023 M | AET27-015/2023 F | |||||||
52 | AET27-078/23-2024 F | AET27-005/2024 M | AET27-022/2023 M | AET27-015/2023 F | |||||||
53 | Cage 18 | AET27-079/23-2024 F | AET27-036/2023 M | AET27-037/2022 F | 18 | AET27-036/2023 M | NIM96-024/2021 M | AET27-011/2022 F | |||
54 | AET27-079/23-2024 F | 5919-001/2023 M | 3024-058/2020 M | 3024-011/2022 F | |||||||
55 | AET27-079/23-2024 F | AET27-022/2022 M | AET27-049/2021 M | AET27-003/2021 F | |||||||
Crossing |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
F2:F55 | List | =Elevage!$R$2:$R$22 |
"Crossing" sheet :
Copier Intersection COL et Lignes .xlsm | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | |||
1 | Females | ||||||||||||||||||||
2 | Males | NIM96-010/2021 F | AET27-026/2022 F | AET27-037/2022 F | AET27-038/2022 F | AET27-017/2023 F | AET27-023/2023 F | AET27-012/2024 F | AET27-014/2024 F | AET27-019/2024 F | AET27-023/2024 F | AET27-035/2024 F | AET27-036/2024 F | AET27-044/2024 F | AET27-046/2024 F | AET27-047/2024 F | AET27-060/2024 F | AET27-078/23-2024 F | AET27-079/23-2024 F | ||
3 | NIM96-008/2021 M | 2,01% | 2,01% | 27,57% | 14,53% | 1,71% | 28,13% | 8,15% | 8,11% | 14,53% | 14,53% | 1,86% | 1,86% | 1,45% | 14,25% | 14,25% | 7,71% | 1,32% | 1,32% | ||
4 | AET27-022/2022 M | 8,00% | 8,00% | 4,45% | 26,34% | 7,02% | 0,94% | 6,83% | 7,73% | 26,34% | 26,34% | 7,50% | 7,50% | 5,52% | 28,08% | 28,08% | 14,71% | 29,39% | 29,39% | ||
5 | AET27-035/2022 M | 2,29% | 2,29% | 1,66% | 2,06% | 4,80% | 1,05% | 8,49% | 1,46% | 2,06% | 2,06% | 3,54% | 3,54% | 5,58% | 2,36% | 2,36% | 5,46% | 3,94% | 3,94% | ||
6 | 5919-001/2023 M | 5,00% | 5,00% | 9,75% | 26,68% | 4,37% | 27,03% | 10,61% | 11,04% | 26,68% | 26,67% | 4,67% | 4,67% | 3,48% | 18,03% | 18,03% | 14,33% | 15,34% | 15,34% | ||
7 | NIM96-020/2023 M | 28,13% | 28,15% | 15,07% | 5,00% | 6,66% | 2,01% | 5,72% | 28,56% | 5,00% | 5,00% | 28,45% | 28,46% | 17,37% | 11,52% | 11,52% | 5,80% | 7,32% | 7,32% | ||
8 | AET27-022/2023 M | 0,00% | 0,00% | 0,00% | 0,00% | 0,00% | 0,00% | 0,00% | 0,00% | 0,00% | 0,00% | 0,00% | 0,00% | 0,00% | 0,00% | 0,00% | 0,00% | 0,00% | 0,00% | ||
9 | AET27-036/2023 M | 6,62% | 6,62% | 3,76% | 1,98% | 9,60% | 0,89% | 5,30% | 6,38% | 1,98% | 1,98% | 8,11% | 8,11% | 28,70% | 3,41% | 3,41% | 26,38% | 6,34% | 6,34% | ||
10 | AET27-005/2024 M | 2,49% | 2,49% | 4,87% | 25,23% | 2,18% | 13,51% | 5,30% | 5,51% | 13,34% | 13,34% | 2,33% | 2,33% | 1,73% | 9,01% | 9,01% | 13,11% | 7,67% | 7,67% | ||
11 | AET27-006/2024 M | 2,49% | 2,49% | 4,87% | 13,34% | 2,18% | 13,51% | 5,30% | 5,51% | 13,34% | 13,33% | 2,33% | 2,33% | 1,73% | 9,01% | 9,01% | 7,16% | 7,67% | 7,67% | ||
12 | AET27-007/2024 M | 17,38% | 28,44% | 9,41% | 3,48% | 8,13% | 1,45% | 5,51% | 11,94% | 3,48% | 3,48% | 12,75% | 12,75% | 23,04% | 7,46% | 7,46% | 16,08% | 6,82% | 6,82% | ||
13 | AET27-009/2024 M | 17,38% | 28,44% | 9,41% | 3,48% | 8,13% | 1,45% | 5,51% | 11,94% | 3,48% | 3,48% | 12,75% | 12,75% | 23,04% | 7,46% | 7,46% | 16,08% | 6,82% | 6,82% | ||
14 | AET27-013/2024 M | 17,38% | 17,38% | 9,41% | 3,48% | 8,13% | 1,45% | 5,51% | 11,94% | 3,48% | 3,48% | 12,75% | 12,75% | 28,57% | 7,46% | 7,46% | 16,08% | 6,82% | 6,82% | ||
15 | AET27-016/2024 M | 17,38% | 17,38% | 9,41% | 3,48% | 8,13% | 1,45% | 5,51% | 11,94% | 3,48% | 3,48% | 12,75% | 12,75% | 28,57% | 7,46% | 7,46% | 16,08% | 6,82% | 6,82% | ||
16 | AET27-017/2024 M | 17,39% | 17,39% | 9,62% | 4,67% | 28,33% | 1,86% | 7,27% | 19,50% | 4,67% | 4,67% | 28,38% | 28,39% | 12,75% | 8,55% | 8,55% | 6,38% | 17,91% | 17,91% | ||
17 | AET27-026/2024 M | 2,14% | 2,14% | 8,36% | 8,29% | 3,26% | 14,59% | 8,32% | 4,78% | 8,29% | 8,29% | 2,70% | 2,70% | 3,51% | 5,17% | 5,17% | 6,58% | 2,63% | 2,63% | ||
18 | AET27-033/2024 M | 15,55% | 10,02% | 18,29% | 18,20% | 4,27% | 21,04% | 8,75% | 11,91% | 18,20% | 18,20% | 7,14% | 7,14% | 6,44% | 16,82% | 16,82% | 10,53% | 9,82% | 9,82% | ||
19 | AET27-042/2024 M | 15,55% | 10,02% | 18,29% | 18,20% | 4,27% | 21,04% | 8,75% | 11,91% | 18,20% | 18,20% | 7,14% | 7,14% | 6,44% | 16,82% | 16,82% | 10,53% | 9,82% | 9,82% | ||
20 | AET27-043/2024 M | 5,00% | 5,00% | 9,75% | 26,68% | 4,37% | 27,03% | 10,61% | 11,04% | 26,67% | 26,67% | 4,67% | 4,67% | 3,48% | 18,03% | 18,03% | 14,33% | 15,35% | 15,35% | ||
21 | AET27-055/2024 M | 17,50% | 17,50% | 12,80% | 11,04% | 10,47% | 14,36% | 15,71% | 28,54% | 11,04% | 11,04% | 19,52% | 19,52% | 11,93% | 10,25% | 10,25% | 8,70% | 9,09% | 9,09% | ||
22 | AET27-057/2024 M | 4,77% | 4,77% | 6,53% | 15,40% | 3,86% | 14,56% | 18,11% | 6,97% | 15,40% | 15,40% | 4,31% | 4,31% | 3,99% | 11,37% | 11,37% | 9,30% | 10,05% | 10,05% | ||
23 | AET27-067/2024 M | 5,80% | 5,80% | 6,75% | 26,22% | 6,98% | 13,96% | 7,95% | 8,70% | 14,33% | 14,33% | 6,38% | 6,38% | 16,08% | 10,72% | 10,72% | 26,30% | 10,84% | 10,84% | ||
New couples |