View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Add to a "number as text"

Hi Howard,

Am Tue, 7 Oct 2014 01:31:13 -0700 (PDT) schrieb L. Howard:

This line pulls the time value out of the string and is Dimmed as Double to accommodate time and dates:
dblSub = TimeValue(Left(rngC, 5))

This formats the time value as hh:mm (where it was text in the cell)
rngC = Format(dblSub + TimeSerial(0, 4, 0), "hh:mm")


if you concatenate a time or a date with a string without formatting you
will get the value in decimal.

And the "+ TimeSerial(0, 4, 0)" adds 0 hours, 4 minutes, 0 seconds to the time value.


so it is easy to change to other additonal times

And this grabs all the text past the time value. (with a space and up to 99 characters)
& " " & Mid(rngC, 7, 99)


yes, that is all correct
If your text is longer you have to change the 99 to your maximum length


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional