What is the syntax to create a tab in a listbox?

Chr(9)
#example - reads a list of food entries from a sheet
Private Sub loadListbox()
 lstFoods.Clear
 lastEntryRow = Sheets("Foods").Cells(Sheets("Foods").Rows.Count, "A").End(xlUp).Row 'how many foods are there?

 For i = 2 To lastEntryRow 'adds each food entry row into the listbox
 lineDisplay = Sheets("Foods").Cells(i, 1).Value & Chr(9) & Sheets("Foods").Cells(i, 2).Value
 lstFoods.AddItem lineDisplay 
 Next
End Sub

 

Advertisements