Draw perpendicular line from nearest located element to a known point

Hi all,

I want to write a VBA macro which will allow me to draw a perpendicular line from the nearest located element (located from the known point) to a known point. 
Illustration below

Here are my questions
1. How do I locate the nearest element based on the known point?
2. How do I generate a line element perpendicular from the located element to the known point?

Thanks for the help in advance.