Results 1 to 2 of 2
  1. #1
    Bronze Lounger
    Join Date
    Jun 2001
    New York, New York, Lebanon
    Thanked 1 Time in 1 Post

    Text to Columns (XL 97 and >)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Loungers

    Is there a way, via VBA, to determine how many columns will a text be parsed into, without having to count the delimiters?

    The delimiter sometimes is different, and sometimes I get more than 255 columns out of a singe string, so in this case I would like to say, Oh this will not work, so let me take the first 255 columns and do the parsing, and then what is left will be parsed again and again until I am done repeating the process of checking if more than 255 columns will be needed.

    Thanks a Million <img src=/S/money.gif border=0 alt=money width=17 height=15>

    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Pittsburgh, Pennsylvania, USA
    Thanked 342 Times in 335 Posts

    Re: Text to Columns (XL 97 and >)

    You could make your own routine.
    dim an array
    redim it to 255 "row" single "column" Array
    Read a line of text,
    have the code parse it from 1 to 254, in col 1
    whatever is left add to 255th row col 1
    redim preserve the array to 255 rows 2 cols
    read and parse the next line
    redim adding another column, etc , etc
    when complete transpose the array (to make the 255 be the columns
    Export the array into an excel sheet


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts