Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alignment problem with spreadsheet Jorge Cervantes New Users to Excel 4 September 18th 09 07:23 PM
vertical text alignment problem when printing BobD2400 Excel Discussion (Misc queries) 1 January 20th 07 05:07 AM
Problem with OWC11 cells alignment from C# Urotsukidoji Excel Programming 0 November 17th 06 11:20 AM
Command Button Alignment Problem zabo21 Excel Programming 2 August 1st 05 04:26 PM
Text format alignment problem Steve Excel Programming 3 November 27th 03 02:32 PM


All times are GMT +1. The time now is 06:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"