Results 1 to 2 of 2
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Rounding Time Values Automatically

    Greetings!

    Can anyone present code for a text box on a userform to modify time values to be rounded to the nearest minute? 5 minutes? etc? The values are based on the sum of two other userform entities which relay information to the worksheet. Thanks!

    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Rounding Time Values Automatically

    To round to the nearest minute you would use something like this:

    <pre> Round(TimeValue * 1440, 0)/1440
    </pre>


    To the nearest 5 minutes:

    <pre> Round(TimeValue * 288, 0)/288
    </pre>

    Legare Coleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •