ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Col alignment problem (https://www.excelbanter.com/excel-programming/383779-col-alignment-problem.html)

newbie in hell

Col alignment problem
 
Suppose I have a text file like this

Name Wage
Robert 123
John 111,34
Mike 222,55

When I open the text file I get on Excel:

Name Wage
Robert 123
John 111,34
Mike 222,55

Notice that we use Commas as decimal points.
The actual problem is that excel doesn't know how to align numbers when
opening text files.

Can any one help?
I use Excel 2000 o Excel 2003.

Thank you.



MSweetG222

Col alignment problem
 
Hello newbie,

Are you opening the text file with vba or by hand?

If by hand, your Data | Text to Columns | Delimited may not be cleared out.


If by vba, consider:

Workbooks.OpenText FileName:= "MyFileName.txt", Origin:=xlMSDOS, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlNone, _
ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False,
Comma:=False _
, Space:=False, OTHER:=False, FieldInfo:=Array(1, 1)

Hope that works for you.
Good Luck.

--
Thx
MSweetG222



"newbie in hell" wrote:

Suppose I have a text file like this

Name Wage
Robert 123
John 111,34
Mike 222,55

When I open the text file I get on Excel:

Name Wage
Robert 123
John 111,34
Mike 222,55

Notice that we use Commas as decimal points.
The actual problem is that excel doesn't know how to align numbers when
opening text files.

Can any one help?
I use Excel 2000 o Excel 2003.

Thank you.



Gord Dibben

Col alignment problem
 
When you open the text file you should get the Text Import Wizard pop.

In step 3 under Column Data Format select Text for the second column.


Gord Dibben MS Excel MVP

On Thu, 22 Feb 2007 14:40:58 -0800, newbie in hell
wrote:

Suppose I have a text file like this

Name Wage
Robert 123
John 111,34
Mike 222,55

When I open the text file I get on Excel:

Name Wage
Robert 123
John 111,34
Mike 222,55

Notice that we use Commas as decimal points.
The actual problem is that excel doesn't know how to align numbers when
opening text files.

Can any one help?
I use Excel 2000 o Excel 2003.

Thank you.




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com