title: Sorting Worksheet data by column values using Excel VBA
body: <p>I have next userform developed in vba, which takes info from a worksheet for displaying info</p>
  
  <p><img src="https://i.stack.imgur.com/D0BtQ.png" alt="enter image description here"></p>
  
  <p>I want to order all the info aphabetically by a Segment, this is the code:</p>
  
  <pre><code>Function llenarDatosTabla()
  
      Dim vList As Variant
      Dim ws As Worksheet: Set ws = Worksheets(BD_PRODXSIST)
  
      ListBox1.Clear
  
      With ws
          If (IsEmpty(.Range("AA2").Value) = False) Then
  
              Dim ultimoRenglon As Long: ultimoRenglon = devolverUltimoRenglonDeColumna("A1", BD_PRODXSIST)
  
              vList = ws.Range("AA2:AA" &amp; ultimoRenglon &amp; ":AL2").Value
  
              If IsArray(vList) Then
                  Me.ListBox1.List = vList
              Else
                  Me.ListBox1.AddItem (vList)
              End If
  
          End If
  
          Me.ListBox1.ListIndex = -1
  
      End With
  
  
  
  
      Set vList = Nothing
      Set ws = Nothing
  End Function
  </code></pre>
  
  <p>how to make it ordered by 'AD' (SEGMENTO) column???</p>