Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / October 2008

Tip: Looking for answers? Try searching our database.

cell formatting and format conversion

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
adimar - 09 Oct 2008 18:48 GMT
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.
Mike H - 09 Oct 2008 18:54 GMT
Hi,

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

Mike

> I have a question regarding Excel's interpretation of entered info and how
> it converts it.
[quoted text clipped - 11 lines]
>
> Thank you.
adimar - 09 Oct 2008 19:18 GMT
Yes, this works fine.

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

Thank you.

> Hi,
>
[quoted text clipped - 17 lines]
> >
> > Thank you.
Mike H - 09 Oct 2008 19:43 GMT
Hi,

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

Mike

> Yes, this works fine.
>
[quoted text clipped - 24 lines]
> > >
> > > Thank you.
adimar - 09 Oct 2008 20:20 GMT
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.

> Hi,
>
[quoted text clipped - 30 lines]
> > > >
> > > > Thank you.
JLGWhiz - 09 Oct 2008 23:08 GMT
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.

> I find the number conversions work differently than other types.
>
[quoted text clipped - 44 lines]
> > > > >
> > > > > Thank you.
adimar - 10 Oct 2008 16:40 GMT
NumberFormat ="@" works fine.

Thank you.

> 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
[quoted text clipped - 50 lines]
> > > > > >
> > > > > > Thank you.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.