Convert Serial number to Time

Can someone pleae show me how to convert a decimal number to time in
VBA

0.249999999966667 = 6:00:00

Thanks In advance


---
Message posted from http://www.ExcelForum.com/

0
1/22/2004 2:24:15 AM
excel 39879 articles. 2 followers. Follow

7 Replies
1041 Views

Similar Articles

[PageSpeed] 24

Use "Format" "Cells" on the number tab choose "Time"



"mudraker >" <<mudraker.10evqd@excelforum-nospam.com> wrote in message
news:mudraker.10evqd@excelforum-nospam.com...
> Can someone pleae show me how to convert a decimal number to time in
> VBA
>
> 0.249999999966667 = 6:00:00
>
> Thanks In advance
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>


0
ledcomp (18)
1/22/2004 2:39:54 AM
Dave

Thanks for your reply but that is not what i am after.

I have a serial number that I need to convert to time in a vba macro
anf then have the macro process more code


---
Message posted from http://www.ExcelForum.com/

0
1/22/2004 2:53:31 AM
On Wed, 21 Jan 2004 20:24:15 -0600, mudraker
<<mudraker.10evqd@excelforum-nospam.com>> wrote:

>Can someone pleae show me how to convert a decimal number to time in
>VBA
>
>0.249999999966667 = 6:00:00
>
>Thanks In advance
>
>
>---

That value is already equivalent to 6AM because of how Excel stores and
displays dates and times.

If you do something like:

 Const dectime As Date = 0.249999999966667
 MsgBox ("The time is: " & dectime)

The box will display: The time is 6:00:00 AM.

Since that's not quite what you specified, you'd need to format it more
precisely:

MsgBox ("The time is: " & Format(dectime, "h:mm:ss"))

In the latter case, dectime can be either a Date or a Double number type.


--ron
0
1/22/2004 2:55:20 AM
One way

Range("a1").NumberFormat = "hh:mm:ss"

no need for conversion

-- 

Regards,

Peo Sjoblom

"mudraker >" <<mudraker.10evqd@excelforum-nospam.com> wrote in message
news:mudraker.10evqd@excelforum-nospam.com...
> Can someone pleae show me how to convert a decimal number to time in
> VBA
>
> 0.249999999966667 = 6:00:00
>
> Thanks In advance
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>


0
terre081 (3244)
1/22/2004 3:02:23 AM
Maybe CDate() function?

x = CDate(0.249999999966667)
msgbox x  >> gives 6:00:00 AM

--
Rgds
Max
xl 97
----------------------------------------------------
Use xdemechanik <at>yahoo<dot>com for email
-----------------------------------------------------
"mudraker >" <<mudraker.10ex35@excelforum-nospam.com> wrote in message
news:mudraker.10ex35@excelforum-nospam.com...
> Dave
>
> Thanks for your reply but that is not what i am after.
>
> I have a serial number that I need to convert to time in a vba macro
> anf then have the macro process more code
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>


0
demechanik (4694)
1/22/2004 3:38:34 AM
Max 

this is excatly what I was after

thank you


---
Message posted from http://www.ExcelForum.com/

0
1/22/2004 10:44:48 PM
You're welcome, mudraker !
Thanks for the feedback.

--
Rgds
Max
xl 97
----------------------------------
Use xdemechanik <at>yahoo<dot>com for email
-----------------------------------------
"mudraker >" <<mudraker.10gg8m@excelforum-nospam.com> wrote in message
news:mudraker.10gg8m@excelforum-nospam.com...
> Max
>
> this is excatly what I was after
>
> thank you
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>


0
demechanik (4694)
1/22/2004 11:10:14 PM
Reply:

Similar Artilces:

Converting Claris Impact files (old Apple files) to M'soft Visio"
Hello I understand the the best way to access old Claris Impact files are to convert using m'soft visio. I'm completely new to this application & will be grateful if anyone can take me throughm the process of doing this. I've had a look at the Versiontracker website on salvaging claris impact files but I couldn't work out how it could help me! I really need some step by step help. I've got Visio 2007 installed on my XP Pro computer Many thanks Perhaps this link might help: http://www.thefreelibrary.com/Orbital+Successfully+Completes+File+Converter+to+Allow+Cla...

Converting Microsoft Office 2003 Trial into a full version
I have bought a Sony Vaio PCG-GRT360ZG notebook with installed Microsoft Office 2003. I registered Microsoft Office 2003 trial version. Now I am trying to convert it into a full version. Unfortunately I am getting message that my product key (from Certificate of Authenticity) is invalid. My trial version expires in Jan 2005. What should I do ? My product key from Certificate of Authenticity label is : J8FHJ-Q6BJM-G6PVD-FWM2B-PW6J8. Thank you very much Peter. ...

Converting Dates from YYMMDD to MMDDYYYY
Hi All; I'm looking for a format function that will convert a date in the text format of YYMMDD to text format of MMDDYYYY. Any help would be GREATLY appreciated! Thanks in advance! You can't do it using a Format function, but try: Function SwitchDateFormat(YYMMDD As String) As String Dim strDay As String Dim strMonth As String Dim strYear As String If Len(YYMMDD) = 6 Then strYear = Left$(YYMMDD, 2) strMonth = Mid$(YYMMDD, 3, 2) strDay = Right$(YYMMDD, 2) If strYear < "30" Then strYear = "19" & strYear Else strYear =...

Auto Calculate Monthly Time Pace
I need to show how far into a month we are at any given time in % form. I want this to change every day automatically. Example: Today is day 27 of 31 days in January - 87% if today was 2/17/10 it would need to show 17/28 or 61%, 12/20/10 would be 20/31 or 65%, and so on for each day throughout 2010 (12/20/10 would be 65%) Is there a formula or function to do this? Thanks! Heather "HeatherJ" wrote: > I need to show how far into a month we are at any given time in % form. [....] > Today is day 27 of 31 days in January - 87% One way: =day(today()) / ...

Media players opens and keeps trying to refresh about 5 times a mi
I have done numerous spyware chaecks all showing nothing detected I have eliminated any options in the media player that would have it trying to check for updates or web items. Completely at a loss and extremely unhappy the microsoft site does not have an answer. Acer Exyenza Laptop with Win XP , Office 07 and player 11 any help guys? in the time in took to type this meassage the player popped up three times Try disabling (unchecking) all active WMP plug-ins in WMP's Options. If you download and run Process Explorer - http://technet.microsoft.com/en-us/sysinternals/bb8...

How can I prioritize tasks by number in Outlook 2007?
I am trying to create a custom priority for my tasks in Outlook 2007, but I'm not able to edit the field that was created when I changed the settings to include a custom priority. I'm trying to put a number into it, so that I can sort my tasks in a certain category by number, but I'm not able to. We aren't watching you and your explanation is missing details. Where in Outlook are you trying to view the Tasks? There are 3 places to see Tasks. If in the Task Folder, what View are you in? If in Tasks folder you probably need to turn on in-line editing. Regards Judy Gle...

Calculate number of months
Hello, I have a field where I am trying to implement a calculation. I want it to take the date in a cell and subtract it from today's date to show me the total number of months between those two dates. So right now, it looks like =(TODAY())-D3 and it returns 167 - the total number of days. How do I make it show me months? THANK YOU IN ADVANCE =Month(Today())-Month(D3) "TxWebDesigner" <beverly@beverlylanedesigns.com> schreef in bericht news:e3fR#jXWJHA.5032@TK2MSFTNGP05.phx.gbl... > Hello, > > I have a field where I am trying to implement a calculation...

I have a problem with getting a total Sum of numbers (URGENT)
I'd really appreciate if someone could help me here. I am using Microsoft Excel 2002 on a Microsoft Office XP system. I a trying to develop a minor league baseball schedule, but am having som problems. I have attached a copy of my spreadsheet to give everyone some idea o what I'm doing here. I have where the fans list the "RUNS, HITS & ERRORS) of both teams an for each game of the series. I then have it set up in the TOTA WON/LOST column where if the T-Bones RUNS are more than the SALTDOG runs, a "1" appears in the WON column. If the SALTDOGS have a highe numbe...

Run-time error '381' Invalid property array index
Dear All, I am using RMS 2.0, In POS i set security (disable read) on all columns of setting Customer window. But i got this error when i press F7: Run-time error '381' Invalid property array index. Any kind of help will be highly appreciated. Ibrahim Zubair I get the same message when I try to reprint a receipt did you find the answer to this problem? "Ibrahim Zubair" wrote: > Dear All, > > I am using RMS 2.0, In POS i set security (disable read) on all columns of > setting Customer window. But i got this error when i press F7: > Run-time error '...

>>>Notice of Delayed Response Times<<<<
------=_NextPart_0001_48190A22 Content-Type: text/plain Content-Transfer-Encoding: 7bit Dear partners, Thank you for your patience during our recent service delays due to flooding in the Fargo area. We apologize for any inconvenience this may have caused and are working diligently to restore the service level you have become accustomed to receive with this service. We appreciate your patience as we work through posts and inquiries in the order they were received. Thank you for participating in the partner online technical communities! Jen Mehrer Microsoft Partner Newsgroups Suppo...

time formulas
Can anybody give me an advice Lets say i put in first column dime of departure and in second one time of arrival (of course i know have to insert the time ). In third column i get the time spent somwhere. So far everything is ok. The problem occ urs when i want the sum of all differences in the third column (rows are months dates). The autosumm formula wont work and the result is completely wrong. thanks miro Hi format the resulting cell with the custome format [hh]:mm -- Regards Frank Kabel Frankfurt, Germany axiom wrote: > Can anybody give me an advice > > Lets say i put i...

Converting Adobe PageMaker 6.5 files
Does anyone know if you can convert Adobe PageMaker version 6.5 files so that I can use MS Publisher 2007 to edit these files? I suspect the only way is the copy/paste solution. If you don't have PageMaker, maybe Adobe has help. There is a forum here that might have a solution: http://forums.adobe.com/thread/460491;jsessionid=39FEE1914BD4E0C9DF28733ADF71F413.node0?tstart=0 -- Mary Sauer http://msauer.mvps.org/ "SmithinSA" <SmithinSA@discussions.microsoft.com> wrote in message news:5CCB0500-7E15-4EDC-BC04-775B41F13D8F@microsoft.com... > Does anyone know if you can ...

number in system using arrivals and departures
Is there and easy way to figure out the total number of persons in a system if have access to the arrival and departure times. I have tried to use counts with if statements, but I keep getting the number 1. I know this is not correct. Is there any special macros or functions Thanks Hi you may provide some more details about your data. Could you post some example rows (plain text - no attachments please) and describe your expecte result -- Regards Frank Kabel Frankfurt, Germany megv wrote: > Is there and easy way to figure out the total number of persons in a > system if have access...

how would you calculate the number of hits to your website
Hi ,' can some one tell to me the answer of this question On a website, how would you calculate the number of hits to your website ...

columns changed to numbers instead of letters?
I noticed my excel clumns have changed from letters to numbers and forumlas now look like =RC[-1]*R[-3]C[6] I was trying to make the R[-3]C[6] static (using the $) but it errors. Thanks Mike In Excel Options uncheck "R1C1 Reference Style" Gord Dibben MS Excel MVP On Thu, 28 Oct 2010 20:25:30 -0400, Mike <no_please@not.com> wrote: >I noticed my excel clumns have changed from letters to numbers and >forumlas now look like =RC[-1]*R[-3]C[6] >I was trying to make the R[-3]C[6] static (using the $) but it errors. >Thanks >Mike ...

Creating timelines that don't use time as the horizontal measureme
Is it possible to use the timeline functionality of visio without using time as the horizontal meter? I want to have the same functionality of a timeline, but use it to express events that happen over a range of values from 0-100. ...

A way to increase a number in a cell by using the + key
Hi, i do a lot of data entry and am looking for a way to increase the number in a cell (or range of cells) so that i dont have to enter the new number in each time. I have columns that separate items and i use the sheet to show the total count for each item in it's row. eg Item 1 Item 2 Item 3 2 5 4 I'd like to use the + key only to increase the counts for each item. Did i make sense?? It's a Friday and my mind isn't quite up for a lot of detailed explanations, lol. Any assistance would be appreciated. Tim That would require VBA How far are you will...

Conditional Statements and Time Format
Hello, I have a spreadsheet where I need to calculate a range of time in a cell and display a value in another cell. Example is in cell F2 I have a time displayed of 15:34, and in the calculation window it displays as 3:34:00 PM. In Cell F3 I want to display one of three things, "1st shift", "2nd shift" or "3rd shift". Is it possible to use the conditional statements to give me the value of "1st shift" when cell F2 is between >= 07:00 and < 15:00? I can't find anything that speaks to getting thee range information from time. Thanks, Brian ...

reference number #2
--------------------------------- Where does the information in the "reference number" field in the transaction table come from? I see tranactions with reference numbers - the first part of which appears to be the year, month and day - but I can't figure out the second part. It is nothing that we have intentionally entered while ringing out the customer. Pls help. -Tracey ##-----------------------------------------------## Newsgroup Access Courtesy http://www.rockryno.com/ Tax and Accounting Software Forums Web and RSS access to your favorite newsgroup - microsoft.p...

number changes to date ... how do I change
I am trying to do an "age" range: 1-9 10-19 20-29 Instead I get September 9, 2004 or October 19 I can't figure out how to change it. Please help! Thank you! kk Format->Cells->Number Change the type to Text, and it should keep everything the way you want it. If you don't specify a type, Excel takes a guess based on what you enter. Hope that helps. -Bob --- Message posted from http://www.ExcelForum.com/ ...

Time conversion problem
I am trying to write some data analysis macro code and am having problems with how Excel is and isn't storing the times. During a study a researcher enters, for example 4:39. That needs to be 4 minutes and 39 seconds. However, Excel formats it as 4 hours and 39 minutes - as "h:mm". I really want it formatted as "hh:mm:ss" so it would be 00:04:39. If I go in and change the cell format to "hh:mm:ss" it simply writes the value out as 4:39:00. I've tried switching back and forth between various date, general, and text formats to no avail. For a number of reas...

Add numbers accross columns after stripping away text
I have the following data in a spreadsheet: A1 B1 C1 D1 E1 F1 4.5f 6f 3.5f 3f 7.25f I need to be able to add the numbers together to give me 24.25, i.e. strip the fs away. The numbers will always be less than 10 and the there will only ever be .25 or.5 or .75 after the number (I don't know whether that is significant?). If anyone can show me how to do this I would be very grateful. I have been messing around with MID and FIND to no avail and then started thinking that SUMPRODUCT might have to get involved but it all got a bit m...

Random numbers, Canadian Zip Code style #2
Honestly, I don't even know where to begin -- Shocke ----------------------------------------------------------------------- Shocked's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1489 View this thread: http://www.excelforum.com/showthread.php?threadid=26523 ...

Serial Driver Code in C++
I am trying to send a string over serial RS-232 to another computer and wanted to use VC++. Is there some sample code/template I could follow ? It is not very complicated... just somethign that opens the port and writes into it.... and closes the port. Thanks -k On Wed, 13 Aug 2003 21:16:46 -0700, "KP" <drkcp@yahoo.com> wrote: >I am trying to send a string over serial RS-232 to another >computer and >wanted to use VC++. Is there some sample code/template I >could follow ? > >It is not very complicated... just somethign that opens >the port and ...

Automatic date/time aquisition for graphs
Ok, I collect particle count data for a cleanroom which looks like th following: "LASAIR110","04/05/19","15:47:41",2700.0,45.00,"V6.3",0,0,0,1,433,486,236,113,294,196,103,328,4.993,1.0000,0.000,0.000,0.000,0.000,0.000,"22de" "LASAIR110","04/05/19","16:33:15",2700.0,45.00,"V6.3",0,0,0,1,458,432,163,55,107,55,46,139,5.007,1.0000,0.000,0.000,0.000,0.000,0.000,2299 "LASAIR110","04/05/19","17:18:49",2700.0,45.00,"V6.3",0,0,0,1,305,286,76,29,14,1,0,0,5.017,1.0000,0.000...