ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to import data (https://www.excelbanter.com/excel-programming/337016-macro-import-data.html)

Gerald[_2_]

Macro to import data
 
Is it possible to write a macro to convert data? I currently use the
text import wizard but since the file I am importing is not delimited
so I choose fixed width and adjust the columns according to the
heading. The problem is some fields in the data are actually longer
than the heading for that column and thus the contents get spread over
two to three columns. Any help in writting a macro for this, if
possible, would be appreciated.

Thanks!


STEVE BELL

Macro to import data
 
Gerald,

Is the data separated by spaces, tabs, etc?
How is the data separated?

Text-to-Columns allows you to choose one or more of these, and others.
Including one of your own choosing...

The trick is knowing what separates one data byte from the next...

Reply back...

--
steveB

Remove "AYN" from email to respond
"Gerald" wrote in message
oups.com...
Is it possible to write a macro to convert data? I currently use the
text import wizard but since the file I am importing is not delimited
so I choose fixed width and adjust the columns according to the
heading. The problem is some fields in the data are actually longer
than the heading for that column and thus the contents get spread over
two to three columns. Any help in writting a macro for this, if
possible, would be appreciated.

Thanks!




Gerald[_2_]

Macro to import data
 
Steve:

I'm not sure what separates the fields but I have tried choosing
delimited and different combinations of each tab and space. Space
seems to be closer but it seems to be best if I just do fixed width
because only one field doesn't fall into the width of the heading.
Thanks for your help!

Gerald

STEVE BELL wrote:
Gerald,

Is the data separated by spaces, tabs, etc?
How is the data separated?

Text-to-Columns allows you to choose one or more of these, and others.
Including one of your own choosing...

The trick is knowing what separates one data byte from the next...

Reply back...

--
steveB

Remove "AYN" from email to respond
"Gerald" wrote in message
oups.com...
Is it possible to write a macro to convert data? I currently use the
text import wizard but since the file I am importing is not delimited
so I choose fixed width and adjust the columns according to the
heading. The problem is some fields in the data are actually longer
than the heading for that column and thus the contents get spread over
two to three columns. Any help in writting a macro for this, if
possible, would be appreciated.

Thanks!




All times are GMT +1. The time now is 11:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com