ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   "Text to Column" - exceeding maximum number of columns possible (https://www.excelbanter.com/excel-programming/309516-text-column-exceeding-maximum-number-columns-possible.html)

Pauline Chen

"Text to Column" - exceeding maximum number of columns possible
 
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


arno

"Text to Column" - exceeding maximum number of columns possible
 
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




All times are GMT +1. The time now is 02:03 PM.

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