I am exporting data to an excel file. This works, however, one of my columns doesn't format properly with currency. Through code, how can i make an entire column currency just like when i do it through Excel itself, by going to the format options.

I have tried using the Range.NumberFormat, but that only works when value matches my data exactly.

IE: I have 24500.00 and 20000

I want them to show 24,500.00 and 20000.00

Sometimes i get ###### in the column after the export and when i change the option in excel for that column, it works fine. Any ideas? Thanks.

Recommended Answers

All 2 Replies

The ####### in an Excel cell indicates that the data is too big to display in the cell.
I think your problem is not the text formatting but the column width.

I meant to come back on and update this thread yesterday. You are exactly correct. My formatting was fine, i just needed to set the column width. Once i did that, the export was perfect. Thanks for the response.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.