Rabu, 15 Oktober 2014

Re: [ExcelVBA] Help with sum of time


Hi Jeff

2:00 is two hours.  so if you display the minutes and seconds it will be 0:00.

You need something like ="00:"& txtPIM1.Value & ":00"

Or better txtPIM1.Value/60/24

This gives a value in days and fractions of days which is how Excel handles dates and times.

David Grugeon

On 15 October 2014 11:17, jeff.flanagan@duffcorp.ca [ExcelVBA] <ExcelVBA@yahoogroups.com> wrote:

Hi All,

I am trying to create a hockey tracking spreadsheet. One thing I am trying to track is penalty minutes. My input is via a textbox.

Cells(EmptyRow, 13) = txtPIM1.Value + ":00"

I added the + ":00" to display time as 2:00, 5:00, etc. I want to sum the total penalty minutes, but my method gives an incorrect number. I tried formatting the cells to mm:ss but that doesn't work either. If I enter 2 as a value in the textbox txtPIM1, it returns 00:00.

Any help appreciated.


Posted by: David Grugeon <yahoo@grugeon.com.au>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

Visit our ExcelVBA group home page for more info and support files:

More free tutorials and resources available at:




Tidak ada komentar:

Posting Komentar