"Text to Column" - exceeding maximum number of columns possible

P

Pauline Chen

Hi -

I was wondering if it's possible to write a macro for the following:

After importing a .csv file to Excel, I use "Text to Column" to parse the
data. The problem is each line/row has more than 256 columns worth of data.
I'd like to have the rest of the data parsed into the next worksheet.

In other words, if a row contains data that will spread across 356 columns,
when I parse it, first 256 columns will be in sheet 1 and the rest 156 will
be in sheet 2.

Thanks!
Pauline
 
A

arno

Hi Pauline,
In other words, if a row contains data that will spread across 356 columns,
when I parse it, first 256 columns will be in sheet 1 and the rest 156 will
be in sheet 2.

No build in function of excel will help you here. Read the file with a
macro.

Look in VBA-Help for "Input #", this will fill 356 variables for you,
you write them then in sheet1 and sheet2 as you like. Maybe this works
for you, I am not sure. Field delimiters could be a problem if it is
not a comma ",".

Otherwise use "Line Input" and parse through the text and search for
the field delimiter on your own.

arno
 

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