Text Import Wizard Breaklines

B

balterson

When I import a text file and use set widths, there are already preset line
breaks there. Is there a way to set the default location for these lines? I
import text files every day, and have to move the breaks that are there. It
would be much faster to have these preset where I want them. Any hlep would
be great.
 
F

future_vba_expert

If you were using a vba macro, you could automate the whole import. Have you
considered that?
 
J

Joel

Use the macro recorder while performing the operations. Then run the macro
each time you import the file. A dialog box can be added to the code to help
you select the file you want to import.

In excel 2003
Tools - Macro - Start Recording.

Import file

stop recording
Tools - Macro - Stop Recording

Go to VBA window by typing ALT-F11. Find macro under Modules in VBA project
window.
 
B

balterson

I am not sure what you mean. I have use macros all the time, but what is a
VBA macro? There are six different text files that get imported daily into a
it's own separate spreadsheet, and all are named with the date and which
cycle it is. Does a vba macro take that into consideration?
 
F

future_vba_expert

I believe all macros in Excel are written in VBA (Visual Basic for
Applications). As Joel said in his reply, you can record what you are doing
manually, then next time you don't have to go thru all the steps; you can
just run the macro.
 
B

balterson

I am tracking with you now. I edit all the time in Visual Basic, just didn't
know what the vba stood for. So what do I put in place of the file name in
order for it to bring up the open box?
 
F

future_vba_expert

You need to record one of your text import sessions, then run it as needed.
To do this, you go to Tools, Macro, Record New Macro. It will give it a name
for you, or you can name it. When you are done recording, go to Tools, Macro,
Stop Recording. Then go to Tools, Macro, Macros, click on the macro, and
click on Run. If you want to see the code it created for you, instead of Run,
click Edit. You can then modify the code to make it do other text imports, if
they are similar, or whatever other changes you want. Hope that helps.
 

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