Assuming the time is a text, and not a time value, use

Range("L2").offset(0,1).resize(1,3).value =
split(Range(cellalpha).value,":")

On Apr 7, 5:11 pm, Speilman_54 <mbed...@gmail.com> wrote:
> I'm having an issue where I'm trying to separate a cell with time in
> it, for example the cell would conta 8:56:45 and I need each one of
> those numbers into it's on cell so A1 = 8 A2 =56 A3=45.  So far I've
> been able to ge this to work however the system sends the information
> will send data like :45:45 if there work time is less than 1 hour
> which is where I'm receiving Type Mismatch error.  If I could somehow
> insert a 0 when this would solve this issue, but I've tried to but
> unsuccessfully.  Any help would be much appreciated. Code is below
>
> 'staffed time
> '   hour separator
>     LHour = Hour(Range(cellalpha))
>     Range(L2) = LHour
> ' minute separator
>     LMinute = Minute(Range(cellalpha))
>     Range("M2") = LMinute
> ' Seconds separator
>     LSecond = Second(Range(cellalpha))
>     Range("N2") = LSecond

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to