View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
mike allen[_2_] mike allen[_2_] is offline
external usenet poster
 
Posts: 85
Default 6E+02 what is this ugly scientific format?

i am faguely familiar w/ the "E" notation in math (scientific format?), but
it is causing me a problem and i need to know how to re-fomat a number to
NOT imply to be an "E" number. i asked a question earlier about "if it
looks like it is a match, it is a match." well, i found out the problem and
it is when an field (nothing to do w/ math, science...) is brought in to a
spreadsheet and it fits the profile that can be reduced to scientific
(6E+02), excel does it. that messes everything up, though. TRY THIS
OUT...

type in 6004665102 in cell A1 (set column width = 7.5 w/ times new roman at
size 10 to see this ugly transformation to scientific). then type in
'6004665102 in cell B1 (must start w/ the hyphen to eliminate transformation
to scientific format; also can set column width if you like). set both
cells to format--cells--general just so we are on even playing field.
write code:
Sub scientificjunk()
If Range("a1") = Range("b1") Then
MsgBox "they match!"
Else
MsgBox "something's wrong."
End If
End Sub

you can use: trim(B1) or B1.value, etc. all you want in code, but you can't
touch A1 since A1 is ultimately part of large array brought in (maybe in
text, maybe in html...). can you get it to say "they match!"? without
touching cell A1 in spreadsheet or qualifying range("a1") in the code.
my main goal: how can i NOT have A1 revert to scientific when downloaded?
good luck, mike allen