View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default single cell time entry as time - time; Ever seen this?

Hi,

Am Tue, 28 Jan 2014 07:18:36 -0800 (PST) schrieb :

Has anyone ever seen time entered as '7:00 - 9:00' in a TIME formatted cell? (It does allow the entry)

VarType returns string. vba attempts to calculate the difference directly fails - which makes sense to me.

I'm guessing I'll have to isolate these values, convert and calculate elapsed time. The noon and midnight rollovers (12hr clock) is also something I have to deal with manually.


if you may not separate these values try it with formula:
=MOD(MID(A1,FIND("- ",A1)+2,99)-LEFT(A1,FIND(" ",A1)-1),1)
The MOD function works with all times but especially with midnight
rollovers


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2