Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.setup
mstack
 
Posts: n/a
Default Can you change the settings for an Import Wizard

I am trying to import a txt file into Excel. When I go through the wizard, I
choose "fixed Column" width- next- then I have to put my break lines in at
certain measurements. These txt files are always the same so is there a way
to change the default break line settings so they are where I want them to be
whenever I use the import wizard?
  #2   Report Post  
Posted to microsoft.public.excel.setup
Dave Peterson
 
Posts: n/a
Default Can you change the settings for an Import Wizard

Since the .txt files you work with are always the same layout, maybe you could:

1. Start a new workbook
2. Record a macro when you open it and specify each field
3. Add headers/print layout/filters/subtotals, whatever else you can think of.
4. Add a button from the Forms toolbar to the first worksheet in that workbook.
5. Save this workbook.

Next time you need to import the text file, just open this workbook and click
the button.

With all the extra stuff you do in your macro (formatting, filters, freezepanes,
too), maybe you'll even like it better.

===
If the text file can change names, you can even have the macro ask for the name.

Your macro would change slightly, though:

Option Explicit
Sub testme()
Dim myFileName As Variant

myFileName = Application.GetOpenFilename(filefilter:="Text Files, *.txt")

If myFileName = False Then
'do nothing
exit sub
End If

Workbooks.OpenText Filename:=myfilename, ....
'and the rest of your recorded code (including this modified .opentext line)

End Sub

If you have trouble tweaking your code, post back and I'm sure you'll get help.

mstack wrote:

I am trying to import a txt file into Excel. When I go through the wizard, I
choose "fixed Column" width- next- then I have to put my break lines in at
certain measurements. These txt files are always the same so is there a way
to change the default break line settings so they are where I want them to be
whenever I use the import wizard?


--

Dave Peterson
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
I Need a formula to evaluate a cell with + or - values Bob in Oklahoma Excel Worksheet Functions 6 October 31st 05 02:41 PM
change default chart settings for new excel charts automatically Nedwardt Charts and Charting in Excel 0 October 20th 05 08:27 PM
Change default import settings Zodiac Excel Discussion (Misc queries) 2 October 16th 05 01:24 AM
Import wizard limitation Sirocco Excel Discussion (Misc queries) 1 June 23rd 05 02:06 AM
How do I change the default settings in charts? drahcir Charts and Charting in Excel 1 December 14th 04 11:30 PM


All times are GMT +1. The time now is 07:46 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"