AddRowAt?

However, you can add this functionality yourself by extending the Class Listbox :wink:

Insert a Module (or use an existing one) to your project.
Then add this public extension Method to the Module:

Public Sub AddRowAt(Extends l As Listbox, RowNumber As Integer, ParamArray Items() As String)
  If (Items.LastIndex < 0) Then
    l.AddRowAt(RowNumber, "")
    Return
  End If
  
  l.AddRowAt(RowNumber, Items(0))
  If (Items.LastIndex < 1) Then Return
  
  For i As Integer = 1 To Items.LastIndex
    l.CellValueAt(l.LastAddedRowIndex, i) = Items(i)
  Next
End Sub

Now you can use your extension like this:

Listbox1.AddRowAt(0, "red", "green", "blue")

2 Likes