I am trying list records from another sheet instead of ActiveSheet
. Is there a way to achieve this? Thanks.
Public Sub CommandButton4_Click()
ListBox1.ColumnHeads = True
ListBox1.ColumnCount = 7
ListBox1.RowSource = "A2:G1000"
'Count the listbox rows when populated
With ActiveSheet
lastrow = .Range("A2", .Range("A" & .Rows.Count).End(xlUp)).Rows.Count
TextBox3 = lastrow
End With
End Sub