![]() |
#1
|
|||
|
|||
![]()
Hi
I have values like these 41 45.4 which is 41° 45.4min How do I convert this to Deg decimal which can be added and subtracted from each other I also have values of only minutes, like this , 45.4, I also need this in decimal to be added or subtracted from Deg decimal in case 1 Please help |
#2
|
|||
|
|||
![]() |
#3
|
|||
|
|||
![]() Quote:
Hi I would like to have this without doing the seconds separate, just as a decimal to the minutes Converting Decimal Degrees to Degrees/Minutes/Seconds The following Microsoft Visual Basic for Applications custom function accepts an angle formatted as a decimal value and converts it to a text value displayed in degrees, minutes, and seconds. Function Convert_Degree(Decimal_Deg) As Variant With Application 'Set degree to Integer of Argument Passed Degrees = Int(Decimal_Deg) 'Set minutes to 60 times the number to the right 'of the decimal for the variable Decimal_Deg Minutes = (Decimal_Deg - Degrees) * 60 'Set seconds to 60 times the number to the right of the 'decimal for the variable Minute Seconds = Format(((Minutes - Int(Minutes)) * 60), "0") 'Returns the Result of degree conversion '(for example, 10.46 = 10~ 27 ' 36") Convert_Degree = " " & Degrees & "° " & Int(Minutes) & "' " _ & Seconds + Chr(34) End With End Function To use this function, create a conversion formula, as in the following example: Start Excel and press ALT+F11 to start the Visual Basic editor. On the Insert menu, click Module. Enter the sample code for the Convert_Degree custom function described above into the module sheet. Press ALT+F11 to return to excel. In cell A1 type 10.46. In cell A2 type the following formula: =Convert_Degree(A1) |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Rotate Object 180 Degrees | edrichard | PowerPoint | 0 | 09-07-2010 07:59 AM |