Please see attached example file. I would like to get the closest point ID from Sheet2 for each point in Sheet1.
Please see attached example file. I would like to get the closest point ID from Sheet2 for each point in Sheet1.
Last edited by batman07; 08-25-2017 at 08:03 AM.
You can find the distance between two points with
dist = sqrt[ (x1-x2)2 + (y1-y2)2 ]
Write some code to load the inputs into arrays, then create a grid by finding the distance between each point in one array with each point in the other array. Then for each point, find the smallest distance value.
Design everything to be as simple as possible, but no simpler.
Please Login or Register to view this content.
Surround your VBA code with CODE tags e.g.;
[CODE]your VBA code here[/CODE]
The # button in the forum editor will apply CODE tags around your selected text.
Nitpicking here, but you don't need the ABS() function since any number raised to an even power will always be positive
I agree... on both points.
That solved my problem. Thank you very much. (Reputation added)
Simply hit the star button to say THANK YOU.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks