[quote user="Andrew Womsley"]what i was trying to ask was is it possible for me to change the code to something like below[/quote]
Yes, but not this way. Try to find some tutorial with explanation of difference between UDT (User Defined Type) and instance of classes.
Because Range3d is UDT and not class, you cannot use set oRange =, but a simple value assignment oRange = is correct. It's good to remember that if there is no New, set keyword is not used. BTW it also means the name is incorrect, because it's not object, so no "o".
Inside the function, you have to assign return value, something like GetRefDisplayedExtents = calculatedRange.
With regards,
Jan