View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Trevor Shuttleworth Trevor Shuttleworth is offline
external usenet poster
 
Posts: 1,089
Default Macro for TEXT and DP

Aaron

="This weight " & TEXT(A1,"#,##0.00") &" is in " & A2

Regards

Trevor


"Slashman" wrote in message
oups.com...
Hi,

I have a cell that has a mixture of text and numbers. The text comes
through fine, but the numbers only come through as numbers whole ie 300
not 300.00. EG:


="This weight "&A1&" is in "&A2


A1 is 300.00
A2 is g
The cell displays:
This weight 300 is in g
But I would like it to display:
This weight 300.00 is in g

This cant be done with just TEXT formatting, because the numbers DP I
want isnt always going to be 30.00 sometimes it could be 30.0000 and I
would like to be able to have that automatically applied through a
macro, but can it be done by mixing text and number formatting?

Thanks in advance for any help,

Aaron.