# Find Duplicate

#### gnusmas

##### Board Regular
Hi Friend i have sheet with the following values my last range is a refenrence.
I need <acronym title="visual basic for applications">vba</acronym> code to find duplicate IF the neighbors values "+1" OR "-1".
Exemple:

 11 12 14 22 31 47 06 13 28 29 42 43 21 23 27 28 33 48 01 05 11 20 22 30 16 18 24 29 36 44

<tbody>
</tbody>

 16 25 34 41 45 47 15 32 35 36 42 47 06 08 27 28 31 47 13 14 20 28 29 33 09 11 16 19 42 44

<tbody>
</tbody>

Sheet 2 Result

 29 28 20

<tbody>
</tbody>

28
28
19

 28 33 48

<tbody>
</tbody>

<tbody>
</tbody>

 47 29 33

<tbody>
</tbody>
Etc...

Thank you for Help!!

### Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
clear as mud to me

define neighbours

are neighbours up down left right and diagonal

no takers after this time means people do not understand what you want usually....

Thank you friend I apreciate your help !!
Yes the neighbours are up down left right and diagonal!!
Another exemple :

 01 02 12 30 40 47 09 10 17 18 22 47 01 21 30 36 45 48 04 06 20 29 31 37 13 20 24 25 29 44

<tbody>
</tbody>

 11 12 14 22 31 47 06 13 28 29 42 43 21 23 27 28 33 48 01 05 11 20 22 30 16 18 24 29 36 44

<tbody>
</tbody>

30 36 45 in range A1:F5

29 36 44 in range A7:F11

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))

I hope you understand my exemple!

why is 36 listed as its neighbours are 17 18 22 30 45 20 39 41

30 36 45 in range A1:F5

30 36 45 in range A7:F11

"36" in the second exemple and it is duplicate when you look the values left and right the neighbors +1,-1
30 36 45
29 36 44

36 IN A1:F5 does not have 37 or 35 as a neighbour

Replies
5
Views
336
Replies
6
Views
329
Replies
2
Views
147
Replies
4
Views
215
Replies
1
Views
371

1,196,042
Messages
6,013,049
Members
441,746
Latest member
ArtemisAlex

### 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.

### Which adblocker are you using?

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

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