View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Juan Pablo González Juan Pablo González is offline
external usenet poster
 
Posts: 226
Default Formating of Numbers

I think the easiest for you is to use the TEXT() worksheet function, instead
of the Format$() function, like this

Avg = Application.Text(x, formattype)

--
Regards

Juan Pablo González

"Bill" wrote in message
...
Hello,
Hope someone can help. I have a worksheet I use to generate a chart using
VBA code. I then want to label a series, for example, the average on the
chart using the number format on worksheet.

To find the number format, I use:

Formattype = cells(1,1).numberformat

Then I use something like

Avg. = format(x, formattype) to find the avg to put on the chart.

I get weird number formats like $1.28_ when I just use currency.

Any suggestions?

Thanks.

Bill