Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Sinhavacin
 
Posts: n/a
Default Can I save a re-useable template for Text Import Wizard?

I frequently have to import data from an accounts report txt file into Excel
2K, via the Text Import Wizard, fixed width mode. Is there any way to save
the column width settings for future re-use?
  #2   Report Post  
Mike
 
Posts: n/a
Default

No.

"Sinhavacin" wrote:

I frequently have to import data from an accounts report txt file into Excel
2K, via the Text Import Wizard, fixed width mode. Is there any way to save
the column width settings for future re-use?

  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

How about this:

If you're always importing files with the same layout, you could record a macro
when you import one of these files.

Start a new workbook.
Record a macro when you open your text file.

Do all the stuff you want during the import, but keep recording when you add
headers/page setup/filters/subtotals/columnwidths/whatever.

Then plop a button from the Forms toolbar on the worksheet (in the workbook that
contains the code). Assign your macro to this button.

Save that workbook and click the button to test it out!

You could even ask the user (you???) for the name of the file to import:

Option Explicit
Sub testme()

Dim myFileName As Variant

myFileName = Application.GetOpenFilename(filefilter:="Text Files, *.Txt", _
Title:="Pick a File")

If myFileName = False Then
MsgBox "Ok, try later" 'user hit cancel
Exit Sub
End If

Workbooks.OpenText Filename:=myFileName '....rest of recorded code here!

End Sub

You'll have to add all that .opentext stuff from your recorded macro.

Then plop a button from the Forms toolbar on the worksheet (in the workbook that
contains the code). Assign your macro to this button.

Save that workbook and click the button to test it out!

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Sinhavacin wrote:

I frequently have to import data from an accounts report txt file into Excel
2K, via the Text Import Wizard, fixed width mode. Is there any way to save
the column width settings for future re-use?


--

Dave Peterson
  #4   Report Post  
Sinhavacin
 
Posts: n/a
Default

Thanks very much, Dave. I had not thought about creating a macro; I have not
done any of that stuff for a long time, and will have to re-learn (so thanks
for the link as well). I will try it out.

Best wishes,
Sinhavacin


"Dave Peterson" wrote:

How about this:

If you're always importing files with the same layout, you could record a macro
when you import one of these files.

Start a new workbook.
Record a macro when you open your text file.

Do all the stuff you want during the import, but keep recording when you add
headers/page setup/filters/subtotals/columnwidths/whatever.

Then plop a button from the Forms toolbar on the worksheet (in the workbook that
contains the code). Assign your macro to this button.

Save that workbook and click the button to test it out!

You could even ask the user (you???) for the name of the file to import:

Option Explicit
Sub testme()

Dim myFileName As Variant

myFileName = Application.GetOpenFilename(filefilter:="Text Files, *.Txt", _
Title:="Pick a File")

If myFileName = False Then
MsgBox "Ok, try later" 'user hit cancel
Exit Sub
End If

Workbooks.OpenText Filename:=myFileName '....rest of recorded code here!

End Sub

You'll have to add all that .opentext stuff from your recorded macro.

Then plop a button from the Forms toolbar on the worksheet (in the workbook that
contains the code). Assign your macro to this button.

Save that workbook and click the button to test it out!

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Sinhavacin wrote:

I frequently have to import data from an accounts report txt file into Excel
2K, via the Text Import Wizard, fixed width mode. Is there any way to save
the column width settings for future re-use?


--

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
Setting a default save folder for a template postitnote100 Excel Discussion (Misc queries) 1 July 8th 05 09:30 PM
How do I import formmail data to a custom excel template? cxlough41 Excel Worksheet Functions 1 July 1st 05 12:59 AM
How do I save a template for sharing? CynAdmin Excel Discussion (Misc queries) 6 June 18th 05 04:04 PM
Template in Excel prettytwin1 New Users to Excel 1 March 9th 05 09:22 PM
How do I save a record from an excel template to a database in a . Fred Smith Excel Discussion (Misc queries) 1 November 30th 04 01:49 PM


All times are GMT +1. The time now is 05:20 PM.

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"