Populate single listbox merging different ranges from different sheets
Hi all,
I need to populate in a userform a single multicolumn listbox merging different ranges from different sheets.
This is the code:
Code:
Private Sub UserForm_Initialize()
Dim LastRow As Long
LastRow = Sheets("Sheet1").Cells(Rows.Count, "I").End(xlUp).Row + 1
Data = Sheets("Sheet1").Range("A4:I" & LastRow)
With ListBoxPazienti
.ColumnCount = 9
.ColumnWidths = "100"
.List = Data
.ListIndex = -1
End With
End Sub
I would populate this listbox with data of multiple sheets named "Sheet1", "Sheet2", "Sheet3", etc.
All sheets have the same number and name of the columns.
Is it possible? Is there a vba code?
Thanks in advance.
Kind regards,
Fabrizio