Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changes format

Status
Not open for further replies.

lk96

Technical User
Apr 22, 2011
4
US
I have a macro that works pretty well. The only thing I'm having issues with, is occasionally, it changes the number I want to put in, to 001.#INF.

For example, I try to have it put in 6E409251, and it changes it to 001.#INF. My macro is set up to pop up a box, stating that the number is wrong and giving me a chance to fix it, but if possible I would like to avoid the box popping up.

I format my excel file as text, and then save it as a csv.

Any assistance would be greatly appreciated.
 

hi,

So are you entering NUMBERS in Scientific Notation? If so, 6E409251 is a pretty HUGE number!!!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I'm not sure why it's doing it.

Anything (or almost anything), that has an E as the second character does it. If my file is formatted as text, why does attachmate change the formatting?
 

A TEXT file, which is what a .csv file is, has NO FORMATTING. It only has TEXT values.

Can you open the .csv in NOTEPAD and inspect the data, because I suspect that Excel may be doing something to your data.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I was hoping that you were right, but opening the file in notepad, shows the number the correct way.

 
Never mind. I got it. I added Dim account as string to the macro and it seemed to work.

Whoo hoo!!
 


What happened, before you declared your account variable as string, it assumed it was a variant, and as a variant, probably assumed that your assigned value was a NUMBER and not a STRING. TILT!!!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top