PC Review


Reply
Thread Tools Rate Thread

cell formatting and format conversion

 
 
adimar
Guest
Posts: n/a
 
      9th Oct 2008

I have a question regarding Excel's interpretation of entered info and how
it converts it.

Example 1: I type in the following in a cell: 074410E4
Excel displays it as 7.44E+08

Example 2: I type in the following in a cell: 08121126
Excel displays it as 8121016

I tried setting different formatting for the cells and copying around and
still cannot get the cell to display exactly how I entered it. Same undesired
behavior when copying/pasting with a macro.

My goal is to have the data exactly the way I entered it.


Thank you.

 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      9th Oct 2008
Hi,

Format as text or type an apostrophe ' first. It wont show in the cell.

Mike

"adimar" wrote:

>
> I have a question regarding Excel's interpretation of entered info and how
> it converts it.
>
> Example 1: I type in the following in a cell: > Excel displays it as 7.44E+08
>
> Example 2: I type in the following in a cell: 08121126
> Excel displays it as 8121016
>
> I tried setting different formatting for the cells and copying around and
> still cannot get the cell to display exactly how I entered it. Same undesired
> behavior when copying/pasting with a macro.
>
> My goal is to have the data exactly the way I entered it.
>
>
> Thank you.
>

 
Reply With Quote
 
adimar
Guest
Posts: n/a
 
      9th Oct 2008

Yes, this works fine.

I could prepend with ' in the macro too. Is there another way to stop Excel
making assumptions?

Thank you.


"Mike H" wrote:

> Hi,
>
> Format as text or type an apostrophe ' first. It wont show in the cell.
>
> Mike
>
> "adimar" wrote:
>
> >
> > I have a question regarding Excel's interpretation of entered info and how
> > it converts it.
> >
> > Example 1: I type in the following in a cell: > Excel displays it as 7.44E+08
> >
> > Example 2: I type in the following in a cell: 08121126
> > Excel displays it as 8121016
> >
> > I tried setting different formatting for the cells and copying around and
> > still cannot get the cell to display exactly how I entered it. Same undesired
> > behavior when copying/pasting with a macro.
> >
> > My goal is to have the data exactly the way I entered it.
> >
> >
> > Thank you.
> >

 
Reply With Quote
 
Mike H
Guest
Posts: n/a
 
      9th Oct 2008
Hi,

That would depend which assumption you wanted to challenge. Specifically?

Mike

"adimar" wrote:

>
> Yes, this works fine.
>
> I could prepend with ' in the macro too. Is there another way to stop Excel
> making assumptions?
>
> Thank you.
>
>
> "Mike H" wrote:
>
> > Hi,
> >
> > Format as text or type an apostrophe ' first. It wont show in the cell.
> >
> > Mike
> >
> > "adimar" wrote:
> >
> > >
> > > I have a question regarding Excel's interpretation of entered info and how
> > > it converts it.
> > >
> > > Example 1: I type in the following in a cell: > Excel displays it as 7.44E+08
> > >
> > > Example 2: I type in the following in a cell: 08121126
> > > Excel displays it as 8121016
> > >
> > > I tried setting different formatting for the cells and copying around and
> > > still cannot get the cell to display exactly how I entered it. Same undesired
> > > behavior when copying/pasting with a macro.
> > >
> > > My goal is to have the data exactly the way I entered it.
> > >
> > >
> > > Thank you.
> > >

 
Reply With Quote
 
adimar
Guest
Posts: n/a
 
      9th Oct 2008

I find the number conversions work differently than other types.

If I format the cell as text and paste 074410E4 Excel converts it to
scientific format, overriding the text format previoulsy set.

That's not the case with a cell formatted as text: when I type in 10/1/08 -
it stays as typed and Excel provides info (marker in top left corner) letting
the user to decide the final format.

Also, I can use datevalue() to convert to date, or text(); is there
something similar for numbers, scientific format in this case?

Thank you.


"Mike H" wrote:

> Hi,
>
> That would depend which assumption you wanted to challenge. Specifically?
>
> Mike
>
> "adimar" wrote:
>
> >
> > Yes, this works fine.
> >
> > I could prepend with ' in the macro too. Is there another way to stop Excel
> > making assumptions?
> >
> > Thank you.
> >
> >
> > "Mike H" wrote:
> >
> > > Hi,
> > >
> > > Format as text or type an apostrophe ' first. It wont show in the cell.
> > >
> > > Mike
> > >
> > > "adimar" wrote:
> > >
> > > >
> > > > I have a question regarding Excel's interpretation of entered info and how
> > > > it converts it.
> > > >
> > > > Example 1: I type in the following in a cell: > Excel displays it as 7.44E+08
> > > >
> > > > Example 2: I type in the following in a cell: 08121126
> > > > Excel displays it as 8121016
> > > >
> > > > I tried setting different formatting for the cells and copying around and
> > > > still cannot get the cell to display exactly how I entered it. Same undesired
> > > > behavior when copying/pasting with a macro.
> > > >
> > > > My goal is to have the data exactly the way I entered it.
> > > >
> > > >
> > > > Thank you.
> > > >

 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      9th Oct 2008
Not really sure what you are after, but look at NumberFormat property in VBA
help files and the Type conversion functions. These are useful in many cases
to get the proper values returned for variables and for converting existing
values from worksheet cells to data types required to make VBA execute
correctly.

"adimar" wrote:

>
> I find the number conversions work differently than other types.
>
> If I format the cell as text and paste 074410E4 Excel converts it to
> scientific format, overriding the text format previoulsy set.
>
> That's not the case with a cell formatted as text: when I type in 10/1/08 -
> it stays as typed and Excel provides info (marker in top left corner) letting
> the user to decide the final format.
>
> Also, I can use datevalue() to convert to date, or text(); is there
> something similar for numbers, scientific format in this case?
>
> Thank you.
>
>
> "Mike H" wrote:
>
> > Hi,
> >
> > That would depend which assumption you wanted to challenge. Specifically?
> >
> > Mike
> >
> > "adimar" wrote:
> >
> > >
> > > Yes, this works fine.
> > >
> > > I could prepend with ' in the macro too. Is there another way to stop Excel
> > > making assumptions?
> > >
> > > Thank you.
> > >
> > >
> > > "Mike H" wrote:
> > >
> > > > Hi,
> > > >
> > > > Format as text or type an apostrophe ' first. It wont show in the cell.
> > > >
> > > > Mike
> > > >
> > > > "adimar" wrote:
> > > >
> > > > >
> > > > > I have a question regarding Excel's interpretation of entered info and how
> > > > > it converts it.
> > > > >
> > > > > Example 1: I type in the following in a cell: > Excel displays it as 7.44E+08
> > > > >
> > > > > Example 2: I type in the following in a cell: 08121126
> > > > > Excel displays it as 8121016
> > > > >
> > > > > I tried setting different formatting for the cells and copying around and
> > > > > still cannot get the cell to display exactly how I entered it. Same undesired
> > > > > behavior when copying/pasting with a macro.
> > > > >
> > > > > My goal is to have the data exactly the way I entered it.
> > > > >
> > > > >
> > > > > Thank you.
> > > > >

 
Reply With Quote
 
adimar
Guest
Posts: n/a
 
      10th Oct 2008

NumberFormat ="@" works fine.

Thank you.

"JLGWhiz" wrote:

> Not really sure what you are after, but look at NumberFormat property in VBA
> help files and the Type conversion functions. These are useful in many cases
> to get the proper values returned for variables and for converting existing
> values from worksheet cells to data types required to make VBA execute
> correctly.
>
> "adimar" wrote:
>
> >
> > I find the number conversions work differently than other types.
> >
> > If I format the cell as text and paste 074410E4 Excel converts it to
> > scientific format, overriding the text format previoulsy set.
> >
> > That's not the case with a cell formatted as text: when I type in 10/1/08 -
> > it stays as typed and Excel provides info (marker in top left corner) letting
> > the user to decide the final format.
> >
> > Also, I can use datevalue() to convert to date, or text(); is there
> > something similar for numbers, scientific format in this case?
> >
> > Thank you.
> >
> >
> > "Mike H" wrote:
> >
> > > Hi,
> > >
> > > That would depend which assumption you wanted to challenge. Specifically?
> > >
> > > Mike
> > >
> > > "adimar" wrote:
> > >
> > > >
> > > > Yes, this works fine.
> > > >
> > > > I could prepend with ' in the macro too. Is there another way to stop Excel
> > > > making assumptions?
> > > >
> > > > Thank you.
> > > >
> > > >
> > > > "Mike H" wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > Format as text or type an apostrophe ' first. It wont show in the cell.
> > > > >
> > > > > Mike
> > > > >
> > > > > "adimar" wrote:
> > > > >
> > > > > >
> > > > > > I have a question regarding Excel's interpretation of entered info and how
> > > > > > it converts it.
> > > > > >
> > > > > > Example 1: I type in the following in a cell: > Excel displays it as 7.44E+08
> > > > > >
> > > > > > Example 2: I type in the following in a cell: 08121126
> > > > > > Excel displays it as 8121016
> > > > > >
> > > > > > I tried setting different formatting for the cells and copying around and
> > > > > > still cannot get the cell to display exactly how I entered it. Same undesired
> > > > > > behavior when copying/pasting with a macro.
> > > > > >
> > > > > > My goal is to have the data exactly the way I entered it.
> > > > > >
> > > > > >
> > > > > > Thank you.
> > > > > >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How do I add the negative format of ( ) to cell formatting in exc. BenjieLop Microsoft Excel Worksheet Functions 0 20th Sep 2004 11:48 PM
How do I add the negative format of ( ) to cell formatting in exc. Marion Microsoft Excel Worksheet Functions 0 20th Sep 2004 11:23 PM
Re: How do I add the negative format of ( ) to cell formatting in exc. Frank Kabel Microsoft Excel Worksheet Functions 0 20th Sep 2004 08:26 PM
Disable automatic conversion of cell format? Christopher Reitz Microsoft Excel Misc 2 23rd Jul 2004 11:32 PM
Formatting cell time format floodlanduk Microsoft Excel Discussion 3 20th Aug 2003 12:18 PM


Features
 

Advertising
 

Newsgroups
 


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