-
Open .csv from code
How can I change this to not be fixed width:
[VBA]Workbooks.OpenText filename:=UsGrowersTextFile, _
Origin:=437, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array( _
Array(0, 1), Array(49, 1)), TrailingMinusNumbers:=True[/VBA]
I want it to be comma separated. However, it does not autocomplete for me to find the DataType for .csv
-
This works for me
[VBA]
Workbooks.Open Filename:="S:\telnos\outlook.csv"
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
-
mdmackillop,
that is not the issue (my fault) it opens but I want it to separate into different columns by commas not by Fixed Width - automatically. There are about 10 columns in the text file that need to separate by commas.
-
From Help File
Try changing tab:=True to Comma:=True
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules