You may want to look over the
Things addons/macros can't do sticky thread. Addons cannot know the exact position of any units other than yourself and your party/raid members, so it's not possible to have an accurate display of the exact distance to arbitrary units. The best you can do is guess by checking whether spells with different ranges are in range, estimating based on how spells go in/out of range as you move, or by triangulating using data communicated by other players using the same addon.
The first addon Jeruku linked is probably your best bet.