Changes

From Fellrnr.com, Running tips
Jump to: navigation, search

Excel Macros for pace

1,311 bytes added, 17:33, 11 February 2010
no edit summary
http://jfsavage.smugmug.com/photos/783141751_GX4AM-O.jpg
6 Paste Copy and paste the macro macros shown below into the text window . You can copy one, some or all of the macros.
http://jfsavage.smugmug.com/photos/783147748_YD3UM-O.jpg
==Usage==
Excel will interpret a pace as a time by default, so entering 7:40 00 will become 7:4000:00 AM, which will mess things up. Enter any paces with a preceding quotation mark such as ‘7:40 00 to make it textual.
http://jfsavage.smugmug.com/photos/783147754_WpFmi-O.jpg
To convert a pace to the number of seconds use =HMS2S(cell), such as =HMS2S(B1B2). To convert seconds to a pace use S2MS for minutes:seconds, or S2HMS for hours:minutes:seconds.
If you wanted to add five seconds per mile, use =S2MS(HMS2S(b1B2)+5)
http://jfsavage.smugmug.com/photos/783147770_SoM3Q-O.jpg
 
==Saving a file with Macros==
To save an excel file that contains macros, you have to save it as a '.xslm' file.
 
http://jfsavage.smugmug.com/photos/786106685_MJMUP-O.jpg
 
==Loading a file containing macros==
By default, macros are disabled when you load an excel file. You will see a security warning with an options box. To enable the macros, click on 'options' and select 'enable this content'.
 
If you do not enable the content, the macros will result in an Excel error '#NAME?'
 
http://jfsavage.smugmug.com/photos/786107613_kSYvf-O.jpg
 
==Troubleshooting==
 
If you get an error saying #VALUE? like this
 
http://jfsavage.smugmug.com/photos/786110756_4dKCW-O.jpg
 
The problem is probably that you have the wrong data type. In the case above, the macro S2MS (seconds to Minutes:Seconds) requires an integer number of seconds, not a 'minutes:seconds' value. Equally MS2S requires Minutes:Seconds to work correctly.
 
==Brief Documentation==
{| {{table}}
|-
| Macro || Usage
|-
|S2HMS ||Convert number of seconds to hours:minutes:seconds
|-
|S2MS ||Convert number of seconds to minutes:seconds
|-
|HMS2S||Convert hours:minutes:seconds or minutes:seconds to number of seconds
|-
|PaceToMPH||Convert minutes:seconds as minutes/mile to miles per hour
|}
End Function
Function S2MS(TotalSeconds)
Dim minutes As Integer
End Function
Function HMS2S(HMSStr)
Dim TimeParts() As String
End Function
Function PaceToMPH(PaceStr)
Dim PaceParts() As String

Navigation menu