LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Is this right

I am new to VB and been asked to fix up a book so all the sheets are the
same now.

At present time, time is enter on a few sheets are like this 1645.30 and
is used to calculate time from different between cols (i.e..) col dd7
(1245.45) minus col p7(1230.25) for col df that has =runtime(dd7) in it
that gives 15.20. Start point for each row is different and there is
more than 1 =runtime() col in the row.

I need to change how the time is enter from 1245.45 to 12:45:45 that is
been added on other sheet with quick time enter code.

The only part of the code I see that needs to be change is this

STstr = Format(StartTime, "0000.00")
ETstr = Format(EndTime, "0000.00")

stH = Left(STstr, 2)
stMIN = Mid(STstr, 3, 2)
stSEC = Right(STstr, 2)

etH = Left(ETstr, 2)
etMIN = Mid(ETstr, 3, 2)
etSEC = Right(ETstr, 2)

temp = TimeSerial(etH, etMIN, etSEC) - TimeSerial(stH, stMIN, stSEC)


RunTime = CDbl(Format(temp, "hhmm.ss"))



End Function

To this I think, but does not work for some reason.

STstr = Format(StartTime, "00.00.00")
ETstr = Format(EndTime, "00.00.00")

stH = Left(STstr, 2)
stMIN = Mid(STstr, 3, 2)
stSEC = Right(STstr, 2)

etH = Left(ETstr, 2)
etMIN = Mid(ETstr, 3, 2)
etSEC = Right(ETstr, 2)

temp = TimeSerial(etH, etMIN, etSEC) - TimeSerial(stH, stMIN, stSEC)


RunTime = CDbl(Format(temp, "hh.mm.ss"))



End Function

John

 
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



All times are GMT +1. The time now is 03:47 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"