title: vba listbox multicolumn add
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6973287/adding-items-in-a-listbox-with-multiple-columns">Adding items in a Listbox with multiple columns</a>  </p>
  </blockquote>
  
  
  
  <p>With MFC VC++ there are two controls, <code>ListBox</code> and <code>ListCtrl</code>. But with VBA it seems we have only <code>ListBox</code>.</p>
  
  <p>I want to create a listbox with 2 columns (Company_ID, Company_Name).</p>
  
  <p>Here is what I tried:</p>
  
  <ol>
  <li>I created lstbox(control type ListBox)</li>
  <li>Row source type = value list</li>
  <li>I am taking value from user from two edit boxes and when user clicks "add" then it should be added to the listbox with 2 columns.</li>
  </ol>
  
  <p>In the VBA code routine I added the following lines:</p>
  
  <pre><code>lstbox.ColumnCount = 2
  lstbox.AddItem (Company_ID)
  </code></pre>
  
  <p>The following code is not working which seems to be related with adding column value:</p>
  
  <pre><code>lstbox.Column(1,lstbox.ListCount - 1) = Company_name
  </code></pre>
  
  <p>This gives error:</p>
  
  <blockquote>
    <p>Runtime error '424' object required.</p>
  </blockquote>
  
  <p>Could anyone help with vba code to add to multi column listbox.</p>