In a spreadsheet I have 2 columns with latitude and longitude for many points; these would be Lat2 & Long2. I also have the Lat and Longitude for a fixed point; these will be Lat1 & Long1
I would like to use this equation in a macro
but I know that MOD & ATAN2 don't work in VBA.
Is it possible to use something like Worksheet.formula to insert this equation in a column next to the Lat2, Long2 values bearing in mind that the Lat2 & Long cell refs need to increment down the column?
Thanks
I would like to use this equation in a macro
Excel Formula:
MOD(ATAN2(COS(RADIANS(lat1))*SIN(RADIANS(lat2))-SIN(RADIANS(lat1))*COS(RADIANS(lat2))*COS(RADIANS(long2-long1)),COS(RADIANS(lat2))*SIN(RADIANS(long2-long1)))*180/PI(),360
but I know that MOD & ATAN2 don't work in VBA.
Is it possible to use something like Worksheet.formula to insert this equation in a column next to the Lat2, Long2 values bearing in mind that the Lat2 & Long cell refs need to increment down the column?
Thanks
Last edited by a moderator: