Solved

Set Default Import Data Delimiter to Comma

Posted on 2009-04-10
6
1,376 Views
Last Modified: 2012-05-06
When importing data manually from text files using the Text Import Wizard the default delimiter is 'tab'.  I would like to set my Excel default to 'comma' so that I can just bring up the import dialog and click 'Finish' rather than having to click to change the delimiter.  Also, if it is possible to select delimited rather than fixed width as a default, and to set whether or not to treat multiple delimiters together as one that would be even better.

Showing me a way to do this manually through the interface would be best.  But if it is something I can run as an addin or start-up macro that would be OK too.

This is just to improve efficiency.  There is no way to automate this because I want this to be the default for a wide variety of files.  Some of the files have a .csv extension while others have a .txt extension.  The files are generally number tables so commas work fine.  There is no reason to do a string replace on all the files to convert commas to tabs.

Is this possible in Excel 2007?
0
Comment
Question by:dastrw
  • 3
  • 3
6 Comments
 
LVL 2

Expert Comment

by:pgunda
ID: 24117862
If all the file contains is a comma separated values, you could change the extension of the file to .CSV and open in Excel.
0
 
LVL 2

Author Comment

by:dastrw
ID: 24117999
I don't just want to import data into a blank workbook.  I also want to import data into an existing workbook.

Changing the extension won't work in these cases.
0
 
LVL 2

Accepted Solution

by:
pgunda earned 500 total points
ID: 24118222
Select the column you want to convert, and run the following macro by pressing a shortcut key assigned.

You can store this macro in your  "personal macro workbook" so it is available from any excel workbook. You can assign a short cut key to this.
Sub Macro2()
'
' Macro2 Macro
'

'
    Selection.TextToColumns Destination:=ActiveCell, DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
        Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
        :=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
End Sub

If you need more help on using this macro.. let me know. But this works. I just tried this.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 2

Author Comment

by:dastrw
ID: 24118852
So basically you're saying is that I just:

1.  Import the file with the default Tab delimiters
2.  Since there are no Tabs in my file everything will end up in a single column
3.  Then do Text To Columns by macro with comma delimiters

Is that right?
0
 
LVL 2

Expert Comment

by:pgunda
ID: 24118929
yes
0
 
LVL 2

Author Comment

by:dastrw
ID: 24119116
That worked.

I'm going to keep this Q open a bit longer to see if there are any ways to get the import to work correctly without having to do a Text-to-column.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question