View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
zhj23 zhj23 is offline
external usenet poster
 
Posts: 60
Default convert percentage to text

Thanks for the valuable helps.

Bcos some of my data are in simple numeric (eg 2.63) and some are in
percentage numeric form (eg 24.32%), obviuosly I dont want to convert 2.63 to
263.00%.

Question: how can I evaluate in VBA whether a cell is in simple numeric or
percentage numeric form?

zhj23

"JE McGimpsey" wrote:

One way:

Debug.Print Format(0.2432, "0.00%")

or, in XL

=TEXT(0.2432, "0.00%")

In article ,
zhj23 wrote:

when a percentage is converted to text, it always gives the decimal form.
e.g. 24.32% will become 0.2432. How can I keep "24.32%" in text form? I guess
there is a better way to do it in VBA than to first add an apostrophe in the
worksheet cell.

Many thanks.

zhj23