Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Display error?
Hi
Excel 2000. I use a recordset (ADO) to retrieve and loop out data into a spreadsheet. Everything works fine except for one thing - currency data is displayed as string data (left-aligned) in the spreadsheet. After the data is looped out into the spreadsheet I have to manually activate the cells (using F2) and press ENTER. Only then are the numbers correctly formatted. The datatype in the particular column in the recordset is vbDecimal. The numberformat of the cell in the spreadsheet is "#,##0". I've tried to convert the decimal datatype to currency (cCur) before looping it out with the same negative result. Any ideas? Regards PO |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Display error?
There's probably a better way that someone will throw out here, but here's
one suggestion that I believe will work. Add some code that will hit each cell in the particular column you need fixed that will essentially do what you're doing now: Sub Test() Dim rng As Range, c As Variant Set rng = Range("I:I") For Each c In rng c.Value = c.Value Next c End Sub Of course, you would need to change the column as necessary. "PO" <po wrote in message ... Hi Excel 2000. I use a recordset (ADO) to retrieve and loop out data into a spreadsheet. Everything works fine except for one thing - currency data is displayed as string data (left-aligned) in the spreadsheet. After the data is looped out into the spreadsheet I have to manually activate the cells (using F2) and press ENTER. Only then are the numbers correctly formatted. The datatype in the particular column in the recordset is vbDecimal. The numberformat of the cell in the spreadsheet is "#,##0". I've tried to convert the decimal datatype to currency (cCur) before looping it out with the same negative result. Any ideas? Regards PO |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is it possible to treat and display a #div/0 error as a zero? | Excel Worksheet Functions | |||
how to display error message? | Excel Discussion (Misc queries) | |||
how to display an error message | Excel Worksheet Functions | |||
#DIV/0! Error - Need to display 0 or blank | Excel Worksheet Functions | |||
error bars display | Charts and Charting in Excel |