Importing text

P

Paul Hyett

Hi, I wonder if you can help?

When you import data from a text file to Excel you use a wizard that has
three screens. The first screen asks you if the file is delimited and
the second screen asks you for the delimiters. The default is Tabs but
the data I import most often uses Semicolons, so I have to go to the
second page and check the box for Semicolon.

Is there a way to set the default delimiter to Semicolon so I do not
have to go through that exercise all the time?
 
J

Jim Rech

Hi Ron-

This isn't a big help but I find that, if I do a Data, Text to Columns and
specify the semicolon, then any text file imports I do after that the
semicolon remains selected. Excel 2003 anyway.

So you could 'prime' the text import wizard for an Excel session with this
macro:

Sub PrimeTextImport()
Workbooks.Add
ActiveCell.Value = "abc"
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited,
_
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Semicolon:=True
ActiveWorkbook.Close False
End Sub


--
Jim
| Hi Paul
|
| > Is there a way to set the default delimiter to Semicolon so I do not
| > have to go through that exercise all the time?
|
| As far as I know this is not possible
|
| but you can use a macro if you want.
| See this page
| http://www.rondebruin.nl/txtcsv.htm
|
| --
|
| Regards Ron de Bruin
| http://www.rondebruin.nl/tips.htm
|
|
| > Hi, I wonder if you can help?
| >
| > When you import data from a text file to Excel you use a wizard that has
| > three screens. The first screen asks you if the file is delimited and
| > the second screen asks you for the delimiters. The default is Tabs but
| > the data I import most often uses Semicolons, so I have to go to the
| > second page and check the box for Semicolon.
| >
| > Is there a way to set the default delimiter to Semicolon so I do not
| > have to go through that exercise all the time?
| > --
| > Paul Hyett, Cheltenham (change 'invalid83261' to 'blueyonder' to email
me)
 
R

Ron de Bruin

So you could 'prime' the text import wizard for an Excel session with this

You are correct Jim

Thanks
 
P

Paul Hyett

In microsoft.public.excel.misc on Tue, 10 Jul 2007, Jim Rech
Hi Ron-

This isn't a big help but I find that, if I do a Data, Text to Columns and
specify the semicolon, then any text file imports I do after that the
semicolon remains selected. Excel 2003 anyway.

So you could 'prime' the text import wizard for an Excel session with this
macro:

Sub PrimeTextImport()
Workbooks.Add
ActiveCell.Value = "abc"
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited,
_
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Semicolon:=True
ActiveWorkbook.Close False
End Sub
Thanks for this.

Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top