Hello,
I have a list of coordinates (X,Y) starting in B2, C2. The length of the coordinates varies, input by the user. This example is 130 pairs. E135 shows what the coordinates look like if plotted. The goal is to find the two closest (X,Y) pairs by using the distance formula to compare (X1,Y1) against (X2,Y2)...(X130,Y130)...(Xn,Yn).
When the closest pairs are found the distance and coordinates will be known. In our application a hole will be drilled at these points with a diameter. We must drill the hole at each point but two holes can not over lap or come too close to each other. Picture are included in the file. I have done all of the difficult math and its written out step by step, hopefully without error. I need help transforming the formulas into VBA code. The end goal is to identify the closest two points, use a cell as input for the drill bit radius, confirm that the two holes will not come in contact or close proximity where the separation distance is also an input. Finally to return the area between the hole and the safe distance. I have drawn out all the steps and calculations inside the excel file, just looking for someone to put this into VBA code. I think it might be a little difficult.
Bookmarks