excel - Define range as all data in coumn A on Sheet2 -
my problem want define range data in column on sheet2. code below displays data column of active worksheet. i've tried sheet2.range , not work.
private sub userform_initialize() dim single dim c range manufacturerslist.clear 'make sure listbox empty = 1 each c in sheets(2).range("a1", sheets(2).range("a" & rows.count).end(xlup)) manufacturerslist.additem cells(i, 1).value = + 1 next
you iterating through cells in sheet2 ignoring reference you're creating in actual .additem method.
for each c in sheets(2).range("a1", sheets(2).range("a" & rows.count).end(xlup)) manufacturerslist.additem c.value next
when referenced cells(i, 1).value
using activesheet property parent of cells
.
Comments
Post a Comment