View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
CM CM is offline
external usenet poster
 
Posts: 136
Default Creating a sentence using macros

Edwin,

This assumes that all of your values have the same format as your example,
and that there are single spaces between the 55 and 85 and between the 25 and
200.

=LEFT(A1,2)&" "&TEXT(TRUNC(B1),0)&","&TEXT((B1-TRUNC(B1))*100,0)&"
"&MID(C1,3,5)

Adjust the last '5' to however many characters after ER are possibly needed.



"Edwin" wrote:

Hi,

I have the following info in a worksheet:

A1 B1 C1
55KL 85.25 ER200

I would like to create a macro that would generate the following sentence in
cell A3:

55 85,25 200

Please note that the point in cell B1 was changed with a comma in the
sentence. I have a form with this setting repeating many times, so it would
be nice if the solution involves the active cell and the cells above it from
which the sentence is created instead of specific cell names. This is a
simplify version of what I really need to get done, but it has the basic idea
of what Im trying to achieve.

Any guidance would be greatly appreciated.

Edwin