I wrote this code to place information from a sheet into a list box in my user form. This is the code I wrote but it is telling me something is out of range although I can't figure out what is out of range.
Private Sub PopulateSearchBox()
Dim wsTL2 As Worksheet
Set wsTL2 = Worksheets("Task List2")
Dim last_row As Long
last_row = wsTL2.Cells(wsTL2.Rows.Count, "C").End(xlUp).Row 'the last populated row in C so it covers the whole range of data that I need.
With Me.searchBox
.ColumnHeads = True
.ColumnCount = 3
.ColumnWidths = "100,100,100"
.RowSource = "Task List2!A1:C" & last_row
End With
End Sub