Reusing UDF inputs

ShelleyBelly

New Member
Joined
Mar 2, 2011
Messages
44
Evenin everyone,

I've the below bit of code for a UDF which seams to have a problem. "arrco" seems to calculate correctly but "depco" does not. When i switch these two it is always the first that works and the second that does not.

Code:
Function CourseAlt(Lat1, Lon1, Lat2, Lon2, Lat3, Lon3, Sailmode2, Sailmode3)

        arrco = ArrCourse(Lat1, Lon1, Lat2, Lon2, Sailmode2)
        depco = DepCourse(Lat2, Lon2, Lat3, Lon3, Sailmode3)
         
        CourseAlt = CourseDiff(arrco, depco)


End Function

I believe it's something to do with reusing Lat2 and Lon2.

I'm sure it's an easy fix but I can't figure it, any help would greatly appreciated.

Cheers,

Tom
 
Last edited:

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
If there is a problem, it's in the code for one or more of the three missing functions.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top