vba code

gnusmas

Board Regular
Joined
Mar 5, 2014
Messages
186
Hi friend i need vba code to extract the following value.
Exemple Sheet1

061017293547
101720224041
021422242834
101123313547
060712262944

<tbody>
</tbody>

141516344047
021126303338
040614272846
040811121429
020311243144

<tbody>
</tbody>

Sheet2

06 10 17 06 11 16
10 14 17 11 15 16
29 35 40 30 34 40
28 34 40 28 33 40
34 41 47 34 40 47
11 23 31 11 24 31
06 07 12 06 08 11
06 07 11 06 08 11
12 26 29 12 27 28

thank you for help
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
there are 2 range

i need just to extact the neighbors value if intersect with +1 or -1 or 0
range A 06 10 17 range B 06 11 16

Ray = Array(Array(0, 1), Array(1, 1), Array(1, 0), Array(1, -1), Array(0, -1), Array(-1, -1), Array(-1, 0), Array(-1, 1))
 
Upvote 0
Is this what you want ??????
6,10,176,11,16
6,10,206,11,16
6,10,106,11,11
6,10,66,11,6
6,17,206,16,16
6,17,226,16,24
6,17,146,16,14
6,17,26,16,2
6,17,106,16,11
6,17,66,16,6
6,17,176,16,16
6,10,146,11,14
6,10,26,11,2
10,17,2911,16,29
10,17,2211,16,24
10,17,2011,16,16
10,17,1711,16,16
10,17,1011,16,11
10,20,2211,16,24
10,20,2411,16,24
10,20,1411,16,14
10,20,1711,16,16
10,20,1011,16,11
10,20,2911,16,29
10,17,1411,16,14
10,17,211,16,2
10,17,611,16,6
10,10,1711,11,16
10,10,1411,11,14
10,10,211,11,2
10,10,611,11,6
10,10,1011,11,11
10,6,1011,6,11
10,6,1711,6,16
17,29,3516,29,34
17,29,4016,29,40
17,29,2216,29,24
17,29,2016,29,16
17,29,1716,29,16
17,22,4016,24,40
17,22,2816,24,28
17,22,2416,24,24
17,22,2216,24,24
17,22,2016,24,16
17,22,1716,24,16
17,22,2916,24,29
17,22,3516,24,34
17,20,2216,16,24
17,20,2416,16,24
17,20,1416,16,14
17,20,1716,16,16
17,20,1016,16,11
17,20,2916,16,29
17,17,2016,16,16
17,17,2216,16,24
17,17,1416,16,14
17,17,216,16,2
17,17,1016,16,11
17,17,616,16,6
17,17,1716,16,16
17,10,1716,11,16
17,10,2016,11,16
17,10,1016,11,11
17,10,616,11,6
29,35,4729,34,47
29,35,4129,34,40
29,35,4029,34,40
29,35,2229,34,24
29,35,2929,34,29
29,40,4129,40,40
29,40,3429,40,34
29,40,2829,40,28
29,40,2429,40,24
29,40,2229,40,24
29,40,2929,40,29
29,40,3529,40,34
29,40,4729,40,47
29,22,4029,24,40
29,22,2829,24,28
29,22,2429,24,24
29,22,2229,24,24
29,22,2029,24,16
29,22,1729,24,16
29,22,2929,24,29
29,22,3529,24,34
29,20,2229,16,24
29,20,2429,16,24
29,20,1429,16,14
29,20,1729,16,16
29,20,1029,16,11
29,20,2929,16,29
29,17,2929,16,29
29,17,2229,16,24
29,17,2029,16,16
29,17,1729,16,16
29,17,1029,16,11
35,47,4134,47,40
35,47,4034,47,40
35,47,3534,47,34
35,41,3434,40,34
35,41,2834,40,28
35,41,4034,40,40
35,41,3534,40,34
35,41,4734,40,47
35,40,4134,40,40
35,40,3434,40,34
35,40,2834,40,28
35,40,2434,40,24
35,40,2234,40,24
35,40,2934,40,29
35,40,3534,40,34
35,40,4734,40,47
35,22,4034,24,40
35,22,2834,24,28
35,22,2434,24,24
35,22,2234,24,24
35,22,2034,24,16
35,22,1734,24,16
35,22,2934,24,29
35,22,3534,24,34
35,29,3534,29,34
35,29,4034,29,40
35,29,2234,29,24
35,29,2034,29,16
35,29,1734,29,16
47,41,3447,40,34
47,41,2847,40,28
47,41,4047,40,40
47,41,3547,40,34
47,41,4747,40,47
47,40,4147,40,40
47,40,3447,40,34
47,40,2847,40,28
47,40,2447,40,24
47,40,2247,40,24
47,40,2947,40,29
47,40,3547,40,34
47,40,4747,40,47
47,35,4747,34,47
47,35,4147,34,40
47,35,4047,34,40
47,35,2247,34,24
47,35,2947,34,29
10,14,2211,14,24
10,14,2311,14,24
10,14,1111,14,11
10,14,1011,14,11
10,14,211,14,2
10,14,1711,14,16
10,14,2011,14,16
10,2,1411,2,14
10,2,1111,2,11
10,2,1011,2,11
10,2,1711,2,16
10,10,2011,11,16
17,22,3116,24,31
17,22,2316,24,24
17,22,1116,24,11
17,22,1416,24,14
17,14,2216,14,24
17,14,2316,14,24
17,14,1116,14,11
17,14,1016,14,11
17,14,216,14,2
17,14,1716,14,16
17,14,2016,14,16
17,2,1416,2,14
17,2,1116,2,11
17,2,1016,2,11
17,2,1716,2,16
17,10,1416,11,14
17,10,216,11,2
17,6,1016,6,11
17,6,1716,6,16
17,17,2916,16,29
20,22,4016,24,40
20,22,2816,24,28
20,22,2416,24,24
20,22,2216,24,24
20,22,2016,24,16
20,22,1716,24,16
20,22,2916,24,29
20,22,3516,24,34
20,24,2816,24,28
20,24,3516,24,34
20,24,3116,24,31
20,24,2316,24,24
20,24,2216,24,24
20,24,2016,24,16
20,24,4016,24,40
20,22,3116,24,31
20,22,2316,24,24
20,22,1116,24,11
20,22,1416,24,14
20,14,2216,14,24
20,14,2316,14,24
20,14,1116,14,11
20,14,1016,14,11
20,14,216,14,2
20,14,1716,14,16
20,14,2016,14,16
20,17,2016,16,16
20,17,2216,16,24
20,17,1416,16,14
20,17,216,16,2
20,17,1016,16,11
20,17,616,16,6
20,17,1716,16,16
20,10,1716,11,16
20,10,2016,11,16
20,10,1016,11,11
20,10,616,11,6
20,17,2916,16,29
20,29,3516,29,34
20,29,4016,29,40
20,29,2216,29,24
20,29,2016,29,16
20,29,1716,29,16
22,40,4124,40,40
22,40,3424,40,34
22,40,2824,40,28
22,40,2424,40,24
22,40,2224,40,24
22,40,2924,40,29
22,40,3524,40,34
22,40,4724,40,47
22,28,3424,28,34
22,28,4724,28,47
22,28,3524,28,34
22,28,3124,28,31
22,28,2424,28,24
22,28,2224,28,24
22,28,4024,28,40
22,28,4124,28,40
22,24,2824,24,28
22,24,3524,24,34
22,24,3124,24,31
22,24,2324,24,24
22,24,2224,24,24
22,24,2024,24,16
22,24,4024,24,40
22,22,2424,24,24
22,22,3124,24,31
22,22,2324,24,24
22,22,1124,24,11
22,22,1424,24,14
22,22,1724,24,16
22,22,2024,24,16
22,22,2224,24,24
22,20,2224,16,24
22,20,2424,16,24
22,20,1424,16,14
22,20,1724,16,16
22,20,1024,16,11
22,20,2924,16,29
22,17,2924,16,29
22,17,2224,16,24
22,17,2024,16,16
22,17,1724,16,16
22,17,1024,16,11
22,29,3524,29,34
22,29,4024,29,40
22,29,2224,29,24
22,29,2024,29,16
22,29,1724,29,16
22,35,4724,34,47
22,35,4124,34,40
22,35,4024,34,40
22,35,2224,34,24
22,35,2924,34,29
40,41,3440,40,34
40,41,2840,40,28
40,41,4040,40,40
40,41,3540,40,34
40,41,4740,40,47
40,34,4740,34,47
40,34,3540,34,34
40,34,2840,34,28
40,34,4040,34,40
40,34,4140,34,40
40,28,3440,28,34
40,28,4740,28,47
40,28,3540,28,34
40,28,3140,28,31
40,28,2440,28,24
40,28,2240,28,24
40,28,4040,28,40
40,28,4140,28,40
40,24,2840,24,28
40,24,3540,24,34
40,24,3140,24,31
40,24,2340,24,24
40,24,2240,24,24
40,24,2040,24,16
40,24,4040,24,40
40,22,4040,24,40
40,22,2840,24,28
40,22,2440,24,24
40,22,2240,24,24
40,22,2040,24,16
40,22,1740,24,16
40,22,2940,24,29
40,22,3540,24,34
40,29,3540,29,34
40,29,4040,29,40
40,29,2240,29,24
40,29,2040,29,16
40,29,1740,29,16
40,35,4740,34,47
40,35,4140,34,40
40,35,4040,34,40
40,35,2240,34,24
40,35,2940,34,29
40,47,4140,47,40
40,47,4040,47,40
40,47,3540,47,34
41,34,4740,34,47
41,34,3540,34,34
41,34,2840,34,28
41,34,4040,34,40
41,34,4140,34,40
41,28,3440,28,34
41,28,4740,28,47
41,28,3540,28,34
41,28,3140,28,31
41,28,2440,28,24
41,28,2240,28,24
41,28,4040,28,40
41,28,4140,28,40
41,40,4140,40,40
41,40,3440,40,34
41,40,2840,40,28
41,40,2440,40,24
41,40,2240,40,24
41,40,2940,40,29
41,40,3540,40,34
41,40,4740,40,47
41,35,4740,34,47
41,35,4140,34,40
41,35,4040,34,40
41,35,2240,34,24
41,35,2940,34,29
41,47,4140,47,40
41,47,4040,47,40
41,47,3540,47,34
2,14,222,14,24
2,14,232,14,24
2,14,112,14,11
2,14,102,14,11
2,14,22,14,2
2,14,172,14,16
2,14,202,14,16
2,11,232,11,24
2,11,122,11,12
2,11,72,11,6
2,11,62,11,6
2,11,102,11,11
2,11,22,11,2
2,11,142,11,14
2,11,222,11,24
2,10,112,11,11
2,10,72,11,6
2,10,62,11,6
2,10,22,11,2
2,10,142,11,14
2,10,172,11,16
2,10,102,11,11
2,17,202,16,16
2,17,222,16,24
2,17,142,16,14
2,17,22,16,2
2,17,102,16,11
2,17,62,16,6
2,17,172,16,16
14,22,2414,24,24
14,22,3114,24,31
14,22,2314,24,24
14,22,1114,24,11
14,22,1414,24,14
14,22,1714,24,16
14,22,2014,24,16
14,22,2214,24,24
14,23,3114,24,31
14,23,2614,24,26
14,23,1214,24,12
14,23,714,24,6
14,23,1114,24,11
14,23,1414,24,14
14,23,2214,24,24
14,23,2414,24,24
14,11,2314,11,24
14,11,1214,11,12
14,11,714,11,6
14,11,614,11,6
14,11,1014,11,11
14,11,214,11,2
14,11,1414,11,14
14,11,2214,11,24
14,10,1114,11,11
14,10,714,11,6
14,10,614,11,6
14,10,214,11,2
14,10,1414,11,14
14,2,1414,2,14
14,2,1114,2,11
14,2,1014,2,11
14,2,1714,2,16
14,10,1714,11,16
14,10,1014,11,11
14,17,2014,16,16
14,17,2214,16,24
14,17,1414,16,14
14,17,214,16,2
14,17,1014,16,11
14,17,614,16,6
14,17,1714,16,16
14,20,2214,16,24
14,20,2414,16,24
14,20,1414,16,14
14,20,1714,16,16
14,20,1014,16,11
14,20,2914,16,29
22,31,3524,31,34
22,31,2924,31,29
22,31,2624,31,26
22,31,1224,31,12
22,31,2324,31,24
22,31,2224,31,24
22,31,2424,31,24
22,31,2824,31,28
22,23,3124,24,31
22,23,2624,24,26
22,23,1224,24,12
22,23,724,24,6
22,23,1124,24,11
22,23,1424,24,14
22,23,2224,24,24
22,23,2424,24,24
22,11,2324,11,24
22,11,1224,11,12
22,11,724,11,6
22,11,624,11,6
22,11,1024,11,11
22,11,224,11,2
22,11,1424,11,14
22,11,2224,11,24
22,14,2224,14,24
22,14,2324,14,24
22,14,1124,14,11
22,14,1024,14,11
22,14,224,14,2
22,14,1724,14,16
22,14,2024,14,16
22,17,1424,16,14
22,17,224,16,2
22,17,624,16,6
22,22,4024,24,40
22,22,2824,24,28
22,22,2924,24,29
22,22,3524,24,34
24,28,3424,28,34
24,28,4724,28,47
24,28,3524,28,34
24,28,3124,28,31
24,28,2424,28,24
24,28,2224,28,24
24,28,4024,28,40
24,28,4124,28,40
24,35,4724,34,47
24,35,4424,34,44
24,35,2924,34,29
24,35,2624,34,26
24,35,3124,34,31
24,35,2424,34,24
24,35,2824,34,28
24,35,3424,34,34
24,31,3524,31,34
24,31,2924,31,29
24,31,2624,31,26
24,31,1224,31,12
24,31,2324,31,24
24,31,2224,31,24
24,31,2424,31,24
24,31,2824,31,28
24,23,3124,24,31
24,23,2624,24,26
24,23,1224,24,12
24,23,724,24,6
24,23,1124,24,11
24,23,1424,24,14
24,23,2224,24,24
24,23,2424,24,24
24,22,2424,24,24
24,22,3124,24,31
24,22,2324,24,24
24,22,1124,24,11
24,22,1424,24,14
24,22,1724,24,16
24,22,2024,24,16
24,22,2224,24,24
24,20,2224,16,24
24,20,2424,16,24
24,20,1424,16,14
24,20,1724,16,16
24,20,1024,16,11
24,20,2924,16,29
24,22,4024,24,40
24,22,2824,24,28
24,22,2924,24,29
24,22,3524,24,34
24,40,4124,40,40
24,40,3424,40,34
24,40,2824,40,28
24,40,2424,40,24
24,40,2224,40,24
24,40,2924,40,29
24,40,3524,40,34
24,40,4724,40,47
28,34,4728,34,47
28,34,3528,34,34
28,34,2828,34,28
28,34,4028,34,40
28,34,4128,34,40
28,47,4428,47,44
28,47,2928,47,29
28,47,3528,47,34
28,47,2828,47,28
28,47,3428,47,34
28,35,4728,34,47
28,35,4428,34,44
28,35,2928,34,29
28,35,2628,34,26
28,35,3128,34,31
28,35,2428,34,24
28,35,2828,34,28
28,35,3428,34,34
28,31,3528,31,34
28,31,2928,31,29
28,31,2628,31,26
28,31,1228,31,12
28,31,2328,31,24
28,31,2228,31,24
28,31,2428,31,24
28,31,2828,31,28
28,24,2828,24,28
28,24,3528,24,34
28,24,3128,24,31
28,24,2328,24,24
28,24,2228,24,24
28,24,2028,24,16
28,24,4028,24,40
28,22,4028,24,40
28,22,2828,24,28
28,22,2428,24,24
28,22,2228,24,24
28,22,2028,24,16
28,22,1728,24,16
28,22,2928,24,29
28,22,3528,24,34
28,40,4128,40,40
28,40,3428,40,34
28,40,2828,40,28
28,40,2428,40,24
28,40,2228,40,24
28,40,2928,40,29
28,40,3528,40,34
28,40,4728,40,47
28,41,3428,40,34
28,41,2828,40,28
28,41,4028,40,40
28,41,3528,40,34
28,41,4728,40,47
34,47,4434,47,44
34,47,2934,47,29
34,47,3534,47,34
34,47,2834,47,28
34,47,3434,47,34
34,35,4734,34,47
34,35,4434,34,44
34,35,2934,34,29
34,35,2634,34,26
34,35,3134,34,31
34,35,2434,34,24
34,35,2834,34,28
34,35,3434,34,34
34,28,3434,28,34
34,28,4734,28,47
34,28,3534,28,34
34,28,3134,28,31
34,28,2434,28,24
34,28,2234,28,24
34,28,4034,28,40
34,28,4134,28,40
34,40,4134,40,40
34,40,3434,40,34
34,40,2834,40,28
34,40,2434,40,24
34,40,2234,40,24
34,40,2934,40,29
34,40,3534,40,34
34,40,4734,40,47
34,41,3434,40,34
34,41,2834,40,28
34,41,4034,40,40
34,41,3534,40,34
34,41,4734,40,47
10,11,2311,11,24
10,11,1211,11,12
10,11,711,11,6
10,11,611,11,6
10,11,1011,11,11
10,11,211,11,2
10,11,1411,11,14
10,11,2211,11,24
10,7,1211,6,12
10,7,611,6,6
10,7,1011,6,11
10,7,1111,6,11
10,7,2311,6,24
10,6,711,6,6
10,6,1111,6,11
11,23,3111,24,31
11,23,2611,24,26
11,23,1211,24,12
11,23,711,24,6
11,23,1111,24,11
11,23,1411,24,14
11,23,2211,24,24
11,23,2411,24,24
11,12,2611,12,26
11,12,711,12,6
11,12,1111,12,11
11,12,2311,12,24
11,12,3111,12,31
11,7,1211,6,12
11,7,611,6,6
11,7,1011,6,11
11,7,1111,6,11
11,7,2311,6,24
11,6,711,6,6
11,6,1011,6,11
11,6,1111,6,11
11,10,1111,11,11
11,10,711,11,6
11,10,611,11,6
11,10,211,11,2
11,10,1411,11,14
11,2,1411,2,14
11,2,1111,2,11
11,2,1011,2,11
11,2,1711,2,16
11,14,2211,14,24
11,14,2311,14,24
11,14,1111,14,11
11,14,1011,14,11
11,14,211,14,2
11,14,1711,14,16
11,14,2011,14,16
11,22,2411,24,24
11,22,3111,24,31
11,22,2311,24,24
11,22,1111,24,11
11,22,1411,24,14
11,22,1711,24,16
11,22,2011,24,16
11,22,2211,24,24
23,31,3524,31,34
23,31,2924,31,29
23,31,2624,31,26
23,31,1224,31,12
23,31,2324,31,24
23,31,2224,31,24
23,31,2424,31,24
23,31,2824,31,28
23,26,2924,26,29
23,26,1224,26,12
23,26,2324,26,24
23,26,3124,26,31
23,26,3524,26,34
23,12,2624,12,26
23,12,724,12,6
23,12,1124,12,11
23,12,2324,12,24
23,12,3124,12,31
23,7,1224,6,12
23,7,624,6,6
23,7,1024,6,11
23,7,1124,6,11
23,7,2324,6,24
23,11,2324,11,24
23,11,1224,11,12
23,11,724,11,6
23,11,624,11,6
23,11,1024,11,11
23,11,224,11,2
23,11,1424,11,14
23,11,2224,11,24
23,14,2224,14,24
23,14,2324,14,24
23,14,1124,14,11
23,14,1024,14,11
23,14,224,14,2
23,14,1724,14,16
23,14,2024,14,16
23,22,2424,24,24
23,22,3124,24,31
23,22,2324,24,24
23,22,1124,24,11
23,22,1424,24,14
23,22,1724,24,16
23,22,2024,24,16
23,22,2224,24,24
23,24,2824,24,28
23,24,3524,24,34
23,24,3124,24,31
23,24,2324,24,24
23,24,2224,24,24
23,24,2024,24,16
23,24,4024,24,40
31,35,4731,34,47
31,35,4431,34,44
31,35,2931,34,29
31,35,2631,34,26
31,35,3131,34,31
31,35,2431,34,24
31,35,2831,34,28
31,35,3431,34,34
31,29,4431,29,44
31,29,2631,29,26
31,29,3131,29,31
31,29,3531,29,34
31,29,4731,29,47
31,26,2931,26,29
31,26,1231,26,12
31,26,2331,26,24
31,26,3131,26,31
31,26,3531,26,34
31,12,2631,12,26
31,12,731,12,6
31,12,1131,12,11
31,12,2331,12,24
31,12,3131,12,31
31,23,3131,24,31
31,23,2631,24,26
31,23,1231,24,12
31,23,731,24,6
31,23,1131,24,11
31,23,1431,24,14
31,23,2231,24,24
31,23,2431,24,24
31,22,2431,24,24
31,22,3131,24,31
31,22,2331,24,24
31,22,1131,24,11
31,22,1431,24,14
31,22,1731,24,16
31,22,2031,24,16
31,22,2231,24,24
31,24,2831,24,28
31,24,3531,24,34
31,24,3131,24,31
31,24,2331,24,24
31,24,2231,24,24
31,24,2031,24,16
31,24,4031,24,40
31,28,3431,28,34
31,28,4731,28,47
31,28,3531,28,34
31,28,3131,28,31
31,28,2431,28,24
31,28,2231,28,24
31,28,4031,28,40
31,28,4131,28,40
35,47,4434,47,44
35,47,2934,47,29
35,47,2834,47,28
35,47,3434,47,34
35,44,2934,44,29
35,44,3534,44,34
35,44,4734,44,47
35,29,4434,29,44
35,29,2634,29,26
35,29,3134,29,31
35,29,4734,29,47
35,26,2934,26,29
35,26,1234,26,12
35,26,2334,26,24
35,26,3134,26,31
35,26,3534,26,34
35,31,3534,31,34
35,31,2934,31,29
35,31,2634,31,26
35,31,1234,31,12
35,31,2334,31,24
35,31,2234,31,24
35,31,2434,31,24
35,31,2834,31,28
35,24,2834,24,28
35,24,3534,24,34
35,24,3134,24,31
35,24,2334,24,24
35,24,2234,24,24
35,24,2034,24,16
35,24,4034,24,40
35,28,3434,28,34
35,28,4734,28,47
35,28,3534,28,34
35,28,3134,28,31
35,28,2434,28,24
35,28,2234,28,24
35,28,4034,28,40
35,28,4134,28,40
35,34,4734,34,47
35,34,3534,34,34
35,34,2834,34,28
35,34,4034,34,40
35,34,4134,34,40
47,44,2947,44,29
47,44,3547,44,34
47,44,4747,44,47
47,29,4447,29,44
47,29,2647,29,26
47,29,3147,29,31
47,29,3547,29,34
47,29,4747,29,47
47,35,4447,34,44
47,35,2647,34,26
47,35,3147,34,31
47,35,2447,34,24
47,35,2847,34,28
47,35,3447,34,34
47,28,3447,28,34
47,28,4747,28,47
47,28,3547,28,34
47,28,3147,28,31
47,28,2447,28,24
47,28,2247,28,24
47,28,4047,28,40
47,28,4147,28,40
47,34,4747,34,47
47,34,3547,34,34
47,34,2847,34,28
47,34,4047,34,40
47,34,4147,34,40
6,7,126,6,12
6,7,66,6,6
6,7,106,6,11
6,7,116,6,11
6,7,236,6,24
6,10,116,11,11
6,10,76,11,6
6,11,236,11,24
6,11,126,11,12
6,11,76,11,6
6,11,66,11,6
6,11,106,11,11
6,11,26,11,2
6,11,146,11,14
6,11,226,11,24
7,12,266,12,26
7,12,76,12,6
7,12,116,12,11
7,12,236,12,24
7,12,316,12,31
7,6,76,6,6
7,6,106,6,11
7,6,116,6,11
7,10,116,11,11
7,10,76,11,6
7,10,66,11,6
7,10,26,11,2
7,10,146,11,14
7,11,236,11,24
7,11,126,11,12
7,11,76,11,6
7,11,66,11,6
7,11,106,11,11
7,11,26,11,2
7,11,146,11,14
7,11,226,11,24
7,23,316,24,31
7,23,266,24,26
7,23,126,24,12
7,23,76,24,6
7,23,116,24,11
7,23,146,24,14
7,23,226,24,24
7,23,246,24,24
12,26,2912,26,29
12,26,1212,26,12
12,26,2312,26,24
12,26,3112,26,31
12,26,3512,26,34
12,7,1212,6,12
12,7,612,6,6
12,7,1012,6,11
12,7,1112,6,11
12,7,2312,6,24
12,11,2312,11,24
12,11,1212,11,12
12,11,712,11,6
12,11,612,11,6
12,11,1012,11,11
12,11,212,11,2
12,11,1412,11,14
12,11,2212,11,24
12,23,3112,24,31
12,23,2612,24,26
12,23,1212,24,12
12,23,712,24,6
12,23,1112,24,11
12,23,1412,24,14
12,23,2212,24,24
12,23,2412,24,24
12,31,3512,31,34
12,31,2912,31,29
12,31,2612,31,26
12,31,1212,31,12
12,31,2312,31,24
12,31,2212,31,24
12,31,2412,31,24
12,31,2812,31,28
26,29,4426,29,44
26,29,2626,29,26
26,29,3126,29,31
26,29,3526,29,34
26,29,4726,29,47
26,12,2626,12,26
26,12,726,12,6
26,12,1126,12,11
26,12,2326,12,24
26,12,3126,12,31
26,23,3126,24,31
26,23,2626,24,26
26,23,1226,24,12
26,23,726,24,6
26,23,1126,24,11
26,23,1426,24,14
26,23,2226,24,24
26,23,2426,24,24
26,31,3526,31,34
26,31,2926,31,29
26,31,2626,31,26
26,31,1226,31,12
26,31,2326,31,24
26,31,2226,31,24
26,31,2426,31,24
26,31,2826,31,28
26,35,4726,34,47
26,35,4426,34,44
26,35,2926,34,29
26,35,2626,34,26
26,35,3126,34,31
26,35,2426,34,24
26,35,2826,34,28
26,35,3426,34,34
29,44,2929,44,29
29,44,3529,44,34
29,44,4729,44,47
29,26,2929,26,29
29,26,1229,26,12
29,26,2329,26,24
29,26,3129,26,31
29,26,3529,26,34
29,31,3529,31,34
29,31,2929,31,29
29,31,2629,31,26
29,31,1229,31,12
29,31,2329,31,24
29,31,2229,31,24
29,31,2429,31,24
29,31,2829,31,28
29,35,4429,34,44
29,35,2629,34,26
29,35,3129,34,31
29,35,2429,34,24
29,35,2829,34,28
29,35,3429,34,34
29,47,4429,47,44
29,47,2929,47,29
29,47,3529,47,34
29,47,2829,47,28
29,47,3429,47,34
44,29,4444,29,44
44,29,2644,29,26
44,29,3144,29,31
44,29,3544,29,34
44,29,4744,29,47
44,35,4744,34,47
44,35,4444,34,44
44,35,2944,34,29
44,35,2644,34,26
44,35,3144,34,31
44,35,2444,34,24
44,35,2844,34,28
44,35,3444,34,34
44,47,4444,47,44
44,47,2944,47,29
44,47,3544,47,34
44,47,2844,47,28
44,47,3444,47,34

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Upvote 0
Yes Micke you have so much right result on your list like this:
6,10,17 6,11,16
28,41,47 28,40,47
26,31,23 26,31,24
44,29,35 44,29,34
I am very happy to help me !!
 
Upvote 0
I'm not quite sure what that you mean ???
Questions:-
1) Are the results OK.
2) If so do you want the code that produced the list
3) If not Explain what is wrong.

Do you want the code that produced that list.
 
Upvote 0
You have on your list result double:47,28,47 47,28,47 29,26,12 29,26,12
and must the difference just +1 or -1 no like this 12,31,22 12,31,24 here in the last cell we have +2 "22" & "24"
 
Upvote 0
Try this:-
Data in Range("A1:F5,A8:F12")
Results column "H & I"
Code:
[COLOR=Navy]Sub[/COLOR] MG19Jun31
[COLOR=Navy]Dim[/COLOR] Rng [COLOR=Navy]As[/COLOR] Range, Dn [COLOR=Navy]As[/COLOR] Range, n [COLOR=Navy]As[/COLOR] [COLOR=Navy]Long,[/COLOR] c [COLOR=Navy]As[/COLOR] [COLOR=Navy]Long[/COLOR]
[COLOR=Navy]Dim[/COLOR] Dic [COLOR=Navy]As[/COLOR] Object, Ray [COLOR=Navy]As[/COLOR] Variant, Sp [COLOR=Navy]As[/COLOR] Variant
[COLOR=Navy]Dim[/COLOR] R [COLOR=Navy]As[/COLOR] Variant, aN [COLOR=Navy]As[/COLOR] [COLOR=Navy]Integer,[/COLOR] bN [COLOR=Navy]As[/COLOR] [COLOR=Navy]Integer,[/COLOR] cN [COLOR=Navy]As[/COLOR] [COLOR=Navy]Integer[/COLOR]
[COLOR=Navy]Dim[/COLOR] Ray1, a [COLOR=Navy]As[/COLOR] [COLOR=Navy]Long,[/COLOR] aa [COLOR=Navy]As[/COLOR] [COLOR=Navy]Long,[/COLOR] R1 [COLOR=Navy]As[/COLOR] Range, R2 [COLOR=Navy]As[/COLOR] Range
[COLOR=Navy]         Set[/COLOR] Rng = Range("A1:F5,A8:F12")
          Ray = Array(Array(0, 1), Array(1, 1), Array(1, 0), Array(1, -1), Array(0, -1), Array(-1, -1), Array(-1, 0), Array(-1, 1))
[COLOR=Navy]For[/COLOR] n = 1 To Rng.Areas.Count
  [COLOR=Navy]Set[/COLOR] Dic = CreateObject("scripting.dictionary")
        Dic.CompareMode = vbTextCompare
    [COLOR=Navy]For[/COLOR] [COLOR=Navy]Each[/COLOR] Dn [COLOR=Navy]In[/COLOR] Rng.Areas(n)
        [COLOR=Navy]For[/COLOR] a = 0 To UBound(Ray)
            [COLOR=Navy]On[/COLOR] [COLOR=Navy]Error[/COLOR] [COLOR=Navy]Resume[/COLOR] [COLOR=Navy]Next[/COLOR]
           [COLOR=Navy]Set[/COLOR] R1 = Dn.Offset(Ray(a)(0), Ray(a)(1))
            [COLOR=Navy]For[/COLOR] aa = 0 To UBound(Ray)
               [COLOR=Navy]Set[/COLOR] R2 = R1.Offset(Ray(aa)(0), Ray(aa)(1))
                [COLOR=Navy]If[/COLOR] Not Intersect(Rng.Areas(n), R1) [COLOR=Navy]Is[/COLOR] Nothing And Not Intersect(Rng.Areas(n), R2) [COLOR=Navy]Is[/COLOR] Nothing [COLOR=Navy]Then[/COLOR]
                    [COLOR=Navy]If[/COLOR] Not Dic.exists(Dn.Value & "," & R1 & "," & R2) [COLOR=Navy]Then[/COLOR]
                        Dic.Add (Dn.Value & "," & R1 & "," & R2), Nothing
                    [COLOR=Navy]End[/COLOR] If
                [COLOR=Navy]End[/COLOR] If
            [COLOR=Navy]Next[/COLOR] aa
          [COLOR=Navy]On[/COLOR] [COLOR=Navy]Error[/COLOR] GoTo 0
        [COLOR=Navy]Next[/COLOR] a
    [COLOR=Navy]Next[/COLOR] Dn
[COLOR=Navy]If[/COLOR] n = 1 [COLOR=Navy]Then[/COLOR] Ray1 = Application.Transpose(Dic.Keys)
[COLOR=Navy]Next[/COLOR] n

[COLOR=Navy]For[/COLOR] [COLOR=Navy]Each[/COLOR] R [COLOR=Navy]In[/COLOR] Ray1
Sp = Split(R, ",")
[COLOR=Navy]For[/COLOR] aN = -1 To 1
    [COLOR=Navy]For[/COLOR] bN = -1 To 1
        [COLOR=Navy]For[/COLOR] cN = -1 To 1
        [COLOR=Navy]If[/COLOR] Dic.exists(Sp(0) + aN & "," & Sp(1) + bN & "," & Sp(2) + cN) [COLOR=Navy]Then[/COLOR]
            c = c + 1
             Cells(c, "H") = R: Cells(c, "I") = Sp(0) + aN & "," & Sp(1) + bN & "," & Sp(2) + cN
        [COLOR=Navy]End[/COLOR] If
        [COLOR=Navy]Next[/COLOR] cN
    [COLOR=Navy]Next[/COLOR] bN
[COLOR=Navy]Next[/COLOR] aN
[COLOR=Navy]Next[/COLOR] R
[COLOR=Navy]End[/COLOR] [COLOR=Navy]Sub[/COLOR]
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,268
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top