I am trying to progamatically set an Excel column to type Currency
Hi,
I am using a vb.net application to get data from a database and put it in an Excel worksheet.
In the vb.net code, I'm doing:-
I'm selecting the cell into which I wish to put the data, setting the numberformat to "£#,##0.00", then putting the value in e.g. £200.00
When I subsequently open the Excel workbook, the value correctly appears as e.g. £200.00 but on the Home tab, in the Number section, the dropdown box says 'Custom'
Is there a way to definitively make the column type 'Currency' please?
Thanks,
Kevin
If you manually set a cell to Currency and then would read it's numberformat in VBA, you'd receive something like
$#,##0_);[Red]($#,##0)To showcase the differences:
I know I said VBA but I haven't read anything contradicting VB.NET being different, correct me if I'm wrong.