Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
PO PO is offline
external usenet poster
 
Posts: 66
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to treat and display a #div/0 error as a zero? Andrew Excel Worksheet Functions 4 October 3rd 08 03:05 AM
how to display error message? LunaMoon Excel Discussion (Misc queries) 2 July 6th 08 08:46 PM
how to display an error message Luzzan Excel Worksheet Functions 1 April 10th 07 10:23 AM
#DIV/0! Error - Need to display 0 or blank Brooks W. Excel Worksheet Functions 5 February 14th 07 03:36 PM
error bars display Amy Charts and Charting in Excel 1 December 22nd 06 11:22 PM


All times are GMT +1. The time now is 04:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"