title: Split one column into multiple columns
body: <p>I was wondering if anybody can kindly advise how to split a string with comma-separated values into multiple columns. I have been trying to figure this out but have been having a hard time finding a good solution. (also checked online, seems several that comes close but not necessarily fit what I exactly need) </p>
  
  <p>Let's say I have a worksheet, call it "example", for instance,
  and in the worksheet has the following strings under multiple 
  rows but all in column "A".</p>
  
  <pre><code>20120112,aaa,bbb,ccc,3432 
  20120113,aaa,bbb,ccc
  20120113,ddd,bb,ccc,ddd,eee,fff,ggg,hhhh 
  20120132,aaa,bbb,ccc
  20120112,aaa,bbb,ccc 
  20120112,xxx,bbb,ggg,ggg,333
  20120112,aaa,bbb,ccc 
  20120112,abbd,bbb,ccc
  </code></pre>
  
  <p>How can I create a macro that will split the above into multiple columns.</p>
  
  <p>Just several points </p>
  
  <p>(1) I should be able to specify the worksheet name 
  ex: something like</p>
  
  <p>worksheets("example").range(A,A)   ' </p>
  
  <p>(2) The number of columns and rows are not fixed, and so I do not
  know how many comma-separated values and how many rows there 
  would be before I run the vba script.</p>