I'm having issue assigning values to an array. Getting an out of range error when trying to assign
What I'm trying to do is loop through the rows in a table and assign certain values to load a listbox.
I've been using this:
Set rng = ws.Range("B1:C" & ws.Range("A" & ws.Rows.Count).End(xlUp).Row)
With Me.lbWaste
.Clear
.ColumnHeads = False
.ColumnCount = rng.Columns.Count
'~~> create a one based 2-dim datafield array
myArray = rng
'~~> fill listbox with array values
.List = myArray
'~~> Set the widths of the column here. Ex: For 5 Columns
'~~> Change as Applicable
.ColumnWidths = "100;50;50"
.TopIndex = 0
End With
but since it just copy and pastes the range values, there's hidden rows included in the data returned.
the columns I'm trying to copy to an array are b and c
how would I assign data to array using
for each rng in workbook1.sheets("Sheet1").listobjects("table1").databodyrange.rows
if rng.entirerow.hidden = false then
?