Jumat, 10 Juni 2011

RE: [ExcelVBA] Re: CSV file inconsistency

 

Unfortunately, it does make sense. The only thing in the csv are numbers and
commas. Excel sees the digits and assumes you want to import the field as a
number. Since Excel has no way of knowing the width of the cell, it switches
over to scientific notation. You should be able to reformat the cell to
being a fourteen digit number with no decimal places.

Alternatively, you could give the csv file a txt extension and use the
import wizard which will allow you to specify the column types.

John. Visio MVP

From: ExcelVBA@yahoogroups.com [mailto:ExcelVBA@yahoogroups.com] On Behalf
Of Thomas
Sent: June-09-11 6:22 PM
To: ExcelVBA@yahoogroups.com
Subject: [ExcelVBA] Re: CSV file inconsistency

These are 14 digits number. I format the cells to Text before entering the
value. Then save as CSV.

When I open the CSV file, the value in the column doesn't appear the same
anymore. It is converted into an exponential number such as 9.93E+13.

Strange behaviour??

Regards,
Thomas

--- In ExcelVBA@yahoogroups.com <mailto:ExcelVBA%40yahoogroups.com> , "David
Smart" <smartware.consulting@...> wrote:
>
> Are these large numbers? If so, then Excel will probably not allow any
> other approach. Please give examples of the numbers you're entering.
>
> However, if the numeric values are not really numbers, but are text
strings
> that contain only numeric digits, then you can format the cells as text
> BEFORE you enter the numeric values, and Excel will hopefully respect
that.
>
> Regards, Dave S
>
> ----- Original Message -----
> From: "Thomas" <thomas_lam_us@...>
> To: <ExcelVBA@yahoogroups.com <mailto:ExcelVBA%40yahoogroups.com> >
> Sent: Friday, June 10, 2011 7:02 AM
> Subject: [ExcelVBA] CSV file inconsistency
>
>
> >I entered the numeric values into a new EXCEL and then save it as a CSV
> >file. When I open the CSV file, the value in each column turn into some
> >scientific number (Exponential number). It is not showing the same value
I
> >entered.
> >
> > Is there ways to prevent this from happening?
> >
> > Thanks for your response.
> >
> > Regards,
> > Thomas
> >
> >
> >
> > ------------------------------------
> >
> > ----------------------------------
> > Be sure to check out TechTrax Ezine for many, free Excel VBA articles!
Go
> > here: http://www.mousetrax.com/techtrax to enter the ezine, then search
> > the ARCHIVES for EXCEL VBA.
> >
> > ----------------------------------
> > Visit our ExcelVBA group home page for more info and support files:
> > http://groups.yahoo.com/group/ExcelVBA
> >
> > ----------------------------------
> > More free tutorials and resources available at:
> > http://www.mousetrax.com
> >
> > ----------------------------------Yahoo! Groups Links
> >
> >
> >
> >
> >
> > -----
> > No virus found in this message.
> > Checked by AVG - www.avg.com
> > Version: 10.0.1375 / Virus Database: 1513/3690 - Release Date: 06/09/11
> >
>

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar