excel - I defined all of my variables as variants, but I'm still getting Compile error: ByRef argument type mismatch -


'The part that is bolded is highlighting the debugger - I do not know why it is not working . I tried to be lat_origin , long_origin , dest_lat and dest_long as function variant in the function, but Then this is what I have to say when I use the "slow" statement, imitating if I do not include a blurred statement in the function, then it says that my variable is not defined and light on "radians" Which is a standard Excel function that is inserted.

  option defines the function ("United") as the LATLONDISTANCE (lat_origin single, long_origin single, as in the form of dest_lat singles, dest_long singles) as a worksheet. Activate ActiveSheet.Cells (2, 10) .Selected version dim long_origin version dim dim_lat version dim as lat_origin dim destlong as elements as 'I do not want to include these' dim statement, but if I do not, "is not defined Andean" LATLONDISTANCE is highlighted in the formula, saying that it LATLONDISTANCE = 0.621371 * (6371.1 * ((2 * Asin (SQRT ((sin ((Andean (lat_origin) - radian (dest_lat)) / 2) ^ 2) + because (radian (lat_origin)) * because (radian (dest _lat) Version (idle) as the () (sin ((radian (long_origin) - radians (dest_long)) / 2) ^ 2)))))) end function private sub command button 1_Click () Dim latlong (185, 1) in as iCounter1 integer, iCounter2 integer, as the iCounter3 integer, iCounter4 dim distance as integer (185, 185) version dim lat_origin version dim long_origin version dim dest_lat version dim dest_long version worksheet ( "United") Such as in the form of active range ("I2"). iCounter1 = 0 to 185 iCounter2 = 0 to LatLong (iCounter2 for, iCounter1) = ActiveCell.Offset (iCounter2, iCounter1) = for .Value Next iCounter2 Next iCounter1 1 iCounter2 to iCounter1 = 0 to activate 1 LatLong to 185 (iCounter2, iCounter1) = ActiveCell.Offset (iCounter2, iCounter1) .Value Next iCounter2 Next to iCounter1 to iCounter4 = 0 to 185 Step 1 lat_origin = LatLong (iCounter4, 0) long_origin = LatLong (iCounter4, 1) 185 Step = 0 iCounter3 1 dest_lat = latlong (iCounter3, 0) dest_long = LatLong (iCounter3, 1) distance (iCounter4, iCounter3) = LATLONDISTANCE (lat_origin, long_origin, dest_lat, dest_long) range ( Cells (2, 14), Cell (187, 201)) = Distance (iCounter4, i Counter3) Next iCounter3 step to the next iCounter4 = 0 185 for iCounter4 1 lat_origin = LatLong (iCounter4, 0) long_origin = LatLong (iCounter4, 1) stage 1 dest_lat to = 0 185 iCounter3 = LatLong (iCounter3, 0) dest_long = LatLong (iCounter3, 1) distance (iCounter4, iCounter3) = LATLONDISTANCE (** lat_origin **, long_origin, dest_lat, dest_long) range (cells (2, 14), cell (187, 201)) = distance ( ICounter4, iCounter3) Next iCounter3 Next iCounter4 End Sub    

You can assign all your arguments to Sold as a single S

  function as the LayLeinInteens elements  
But version
then you try to pass them to a (as lat_origin single, long_origin single, dest_lat as single, as dest_long as single). You can not do this as you have to declare the variable as single too.

  lat_origin retarded single-dimensional long_origin single dim dest_lat single dim dest_long single  as  

Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

c# - WPF Expander overlay used in ItemsControl -

android - how to get distance of 2 beacons and make a condtion base on that distance -