Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Number to Time


Here's what I have:


Code
-------------------
tih = Selection
ActiveCell.Offset(0, 1).Select
tih2 = Selection
ActiveCell.Offset(0, 2).Select
tim = Selection
ActiveCell.Offset(0, 1).Select
tim2 = Selection
TimeIn = tih & tih2 & tim & tim
-------------------



TimeIn = "0745"

How do I make the expression TimeIn have a value of 7:45 instead o
745

--
hyyft
-----------------------------------------------------------------------
hyyfte's Profile: http://www.excelforum.com/member.php...fo&userid=1318
View this thread: http://www.excelforum.com/showthread.php?threadid=26549

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Number to Time


Try:


Code
-------------------
tih = Selection
ActiveCell.Offset(0, 1).Select
tih2 = Selection
ActiveCell.Offset(0, 2).Select
tim = Selection
ActiveCell.Offset(0, 1).Select
tim2 = Selection
TimeIn = TimeSerial(tih & tih2, tim & tim2, 0
-------------------



--
kkkni
-----------------------------------------------------------------------
kkknie's Profile: http://www.excelforum.com/member.php...nfo&userid=754
View this thread: http://www.excelforum.com/showthread.php?threadid=26549

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Number to Time

With Selection
TimeIn = TimeSerial(.value& .Offset(0,1).value, .Offset(0,3).value&
..Offset(0,4).value, 0)
End With

--

HTH

RP

"hyyfte" wrote in message
...

Here's what I have:


Code:
--------------------
tih = Selection
ActiveCell.Offset(0, 1).Select
tih2 = Selection
ActiveCell.Offset(0, 2).Select
tim = Selection
ActiveCell.Offset(0, 1).Select
tim2 = Selection
TimeIn = tih & tih2 & tim & tim2
--------------------



TimeIn = "0745"

How do I make the expression TimeIn have a value of 7:45 instead of
745?


--
hyyfte
------------------------------------------------------------------------
hyyfte's Profile:

http://www.excelforum.com/member.php...o&userid=13187
View this thread: http://www.excelforum.com/showthread...hreadid=265496



Reply
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
Convert time stored as decimalised number to time format Emma New Users to Excel 1 April 29th 08 03:06 PM
number to time Stan Halls Excel Worksheet Functions 6 May 4th 07 01:56 AM
time into a number Polochilde Excel Discussion (Misc queries) 6 March 5th 07 04:12 AM
Every time i put a number with period it becomes a date and time excelSOS Excel Discussion (Misc queries) 7 March 7th 06 12:20 AM
Time to number Steved Excel Worksheet Functions 3 April 27th 05 08:00 AM


All times are GMT +1. The time now is 02:22 PM.

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"