title: Populating header of Listbox from column header
body: <p><strong>1. Background &amp; purpose</strong><br />
  I'm creating a userform to display data from the Excel sheet(&quot;DATA&quot;) with table (&quot;Tab1&quot;) of multi-columns like below picture.</p>
  <p>In my form (&quot;TaskMngUserForm&quot;), after clicking on &quot;Task List&quot; button, all data from Tab1 will be displayed on Listbox1 as follows:</p>
  <ul>
  <li>Column header in Tab1 will be displayed on Listbox1 as Header.</li>
  <li>Data from 2nd row to end in Tab1 will be diplay on Listbox1 corresponding to each columns.</li>
  </ul>
  <p>Also I'm adding an event for action &quot;Listbox1_Click()&quot; that returns &quot;Data&quot; sheet row corresponding to the selected Index, from the second column of the selected ListBox1 row.</p>
  <p>UserForm and Listbox<br />
  <a href="https://i.stack.imgur.com/gKUhw.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gKUhw.jpg" alt="enter image description here" /></a></p>
  <p><strong>2. Code</strong></p>
  <pre class="lang-vb prettyprint-override"><code>'4. Event for &quot;Tasks List&quot; button
  Private Sub Button_TaskList_Click()
  
  ListBox1.ColumnWidths = &quot;20;100;80;100;60;100;80;80;80;200;200;200&quot;
  ListBox1.ColumnCount = 12
  
  With ListBox1
  
      '.ColumnHeads = True
      .List = Sheets(&quot;DATA&quot;).Range(&quot;B2&quot;).CurrentRegion.Value
      .RemoveItem (0)
      .ColumnCount = Sheets(&quot;DATA&quot;).Cells(2, 2).CurrentRegion.Columns.Count
              
  End With
  
  Application.ScreenUpdating = True
  Label25.Caption = &quot;Total Tasks: &quot; &amp; (Worksheets(&quot;DATA&quot;).UsedRange.Rows.Count - 1)
  
  End Sub
  
  '6. Event for &quot;Click Listbox&quot; Action
  Private Sub ListBox1_Click()
  
  Dim strAddress As String
  Dim dataSht As Worksheet
          
  With Me
      If .ListBox1.ListIndex &lt;&gt; -1 Then
          Set dataSht = Sheets(&quot;DATA&quot;)
          
          If IsNull(Me.ListBox1.Value) Then
              Call MsgBox(&quot;You are selecting on blank row item&quot; &amp; vbNewLine &amp; &quot;Be careful!&quot;, vbInformation, &quot;Notification&quot;)
              Button_TaskList_Click
              
          Else
              strAddress = GetIndexRow(.ListBox1.List(.ListBox1.ListIndex, 0), dataSht.Columns(&quot;A&quot;))
                  
              '&lt;~~  GetIndexRow returns &quot;Data&quot; sheet row corresponding to the selected Index, which is got from the 2nd column of the selected ListBox row
          
          
              TaskMngUserForm.txtIndex.Value = dataSht.Range(&quot;A&quot; &amp; strAddress).Value
              TaskMngUserForm.cmbSource.Value = dataSht.Range(&quot;B&quot; &amp; strAddress).Value
              TaskMngUserForm.cmbType.Value = dataSht.Range(&quot;C&quot; &amp; strAddress).Value
              TaskMngUserForm.cmbCategory.Value = dataSht.Range(&quot;D&quot; &amp; strAddress).Value
              TaskMngUserForm.cmbPriority.Value = dataSht.Range(&quot;E&quot; &amp; strAddress).Value
              TaskMngUserForm.cmbTaskOwner.Value = dataSht.Range(&quot;F&quot; &amp; strAddress).Value
              TaskMngUserForm.cmbStatus.Value = dataSht.Range(&quot;G&quot; &amp; strAddress).Value
              TaskMngUserForm.txtOpenDate.Value = dataSht.Range(&quot;H&quot; &amp; strAddress).Value
              TaskMngUserForm.txtCloseDate.Value = dataSht.Range(&quot;I&quot; &amp; strAddress).Value
              TaskMngUserForm.txtSubject.Value = dataSht.Range(&quot;J&quot; &amp; strAddress).Value
              TaskMngUserForm.txtDescription.Value = dataSht.Range(&quot;K&quot; &amp; strAddress).Value
              TaskMngUserForm.txtSolution.Value = dataSht.Range(&quot;L&quot; &amp; strAddress).Value
              
          End If
  '   TaskMngUserForm.Show
      End If
  End With
  
  Application.ScreenUpdating = True
  Label25.Caption = &quot;Check in Task.No:  &quot; &amp; txtIndex.Text
  
  End Sub
  </code></pre>
  <p><strong>3. Problem</strong><br />
  I can load data from Tab1 to Listbox1 but I cannot populate column header from Tab1 to Header in Listbox1.</p>