Solved

Set Default Import Data Delimiter to Comma

Posted on 2009-04-10
6
1,364 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 2

Author Comment

by:dastrw
Comment Utility
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
Comment Utility
yes
0
 
LVL 2

Author Comment

by:dastrw
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now