Append Excel VBA ListBox Items to the Next Empty Row
Question details
The user needs an Excel VBA UserForm to append selected ListBox items below existing entries in column C, beginning at C9.

- Product
- Microsoft Excel VBA
- Device & OS
- not provided
- Scenario
- A UserForm writes selected ListBox items to a worksheet each time the procedure runs.
- Observed behavior
- Later runs write items near the top of column C instead of appending them after existing entries.
Identify the destination worksheet and ListBox control names, and confirm that column C is available for entries starting at C9. Save the workbook as an Excel Macro-Enabled Workbook (.xlsm) if it is not already in a macro-enabled format.
Find the last used cell in column C before appending ListBox items
Use this approach to start at C9 when the destination area is empty and append below the last existing entry on later runs.
The procedure searches column C from row 9 downward, then writes each selected ListBox item on a separate row. It appends below the last used cell rather than filling gaps in the existing list.
In Excel, open the VBA editor with Alt+F11. In Project Explorer, open the UserForm and double-click the button that writes the ListBox items.
Replace the button's existing write logic with the following procedure. Change Sheet1, ListBox1, and CommandButton1 to match your workbook and controls: Private Sub CommandButton1_Click() Dim ws As Worksheet Dim lastCell As Range Dim nextRow As Long Dim i As Long Set ws = ThisWorkbook.Worksheets("Sheet1") Set lastCell = ws.Range("C9:C" & ws.Rows.Count).Find( _ What:="*", LookIn:=xlFormulas, LookAt:=xlPart, _ SearchOrder:=xlByRows, SearchDirection:=xlPrevious) If lastCell Is Nothing Then nextRow = 9 Else nextRow = lastCell.Row + 1 End If For i = 0 To Me.ListBox1.ListCount - 1 If Me.ListBox1.Selected(i) Then If nextRow > ws.Rows.Count Then MsgBox "There are no more rows available in column C." Exit Sub End If ws.Cells(nextRow, "C").Value = Me.ListBox1.List(i, 0) nextRow = nextRow + 1 End If Next i End Sub
Open the UserForm, select one or more ListBox items, and click the button. Select items again and click the button a second time; check that the new values appear below the previous entries in column C.

Work with Excel spreadsheets in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and support for common Excel formats, making it easy to move everyday spreadsheet work. It does not fix Excel VBA; check macro and UserForm compatibility before relying on this workbook in WPS.

Frequently Asked Questions
Why does the macro write near the top of column C?
The procedure may be resetting its destination to a fixed row or finding the last cell incorrectly. Search the destination range from C9 downward and set the next row to one below the last used cell.
What happens if C9 is empty but there is data farther down column C?
The procedure searches the entire destination range from C9 to the bottom of the worksheet. If it finds data below C9, it appends after the last used cell instead of starting at C9.
How do I allow users to select more than one ListBox item?
In the VBA editor, select the ListBox on the UserForm and change its MultiSelect property in the Properties window. The procedure loops through the list and writes each selected item.
How can I write items from a different ListBox column?
Change Me.ListBox1.List(i, 0) in the button procedure to the column index you need. ListBox column indexes start at 0, so use 1 for the second column.
Will this Excel UserForm macro run in WPS Office?
VBA and UserForm support can vary by WPS version and configuration. Check compatibility before using the macro in WPS; opening an Excel workbook does not guarantee that its VBA controls will work.




