Formatting

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

Hello,
I have a chart where I format a number in the title. To get the format, I
used a command like:

Varformat = cells(1,1).numberformat

I then format the number to go in the title using:

NC = format(NC, varformat)

I get numbers like: $19,731_

Why does the _ appear?

Thanks in advance.

Bill
 
Because format and cell formatting don't use eactly the same rules. the _
is used as a spacing character to get data to line up in a column. In the
format command, it is taken as a literal.

From the immediate window to be a little more dramatic:
? activecell.NumberFormat
#,##0_);(#,##0)
? format(activecell.Value,activecell.NumberFormat)
1,235_)


Using the text property may do what you want: (skip the format command)

? activeCell.Text
1,235
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top