LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Excel VBA rounding / time handling questions

On Tue, 13 Sep 2005 14:39:57 -0700, "GSpline"
wrote:

This was exactly what I was trying to figure out, Ron. I was able to do this
same thing via another method but it is a bit longer than this one. In
testing your example, I kept getting errors and was finally able to get it
working by changing

Debug.Print _
Application.WorksheetFunction.Text _
(NumSecs / 86400, "[h]""Hrs"":m""Min"":ss""Sec""")

to read as

Debug.Print _
Application.WorksheetFunction.Text _
(NumSecs / 86400, "[h]""Hrs"":m""Min"":ss")&"Sec"

Is there a reason why I could not included the "Sec" within the parenthesis
like the Hrs & Min were?

Thanks again, Ron, this really helped and it seems to be a bit more accurate
than the way I was doing it.


Rich


I don't know why you get the error. I copied your first example above and
pasted into a module. It works correctly without errors.

Perhaps in your module it is not exactly as you have it in your post? When I
get errors in this sort of thing, it's usually because I've got the wrong
number of quote marks someplace.

In any event, I'm glad this approach is working for you.


--ron
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I record (.468) time in Excel without it rounding to .5? SuperDav Excel Discussion (Misc queries) 2 May 17th 06 10:43 PM
Excel Time Sheet - Rounding To Quarter Hours C A Excel Worksheet Functions 2 October 18th 05 07:21 PM
Error handling with a handling routine ben Excel Programming 0 March 15th 05 03:01 PM
Rounding time in excel (2003) Alan Excel Discussion (Misc queries) 3 January 11th 05 04:44 PM
Rounding questions: (Formula and Code) ? Stuart[_5_] Excel Programming 2 April 8th 04 07:05 PM


All times are GMT +1. The time now is 01:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"