excel - Can listbox.rowsource property accept a range? -
according thread: rowsource property error vba
listbox.rowsource can accept range.
however when run
option explicit sub test() userform1.listbox1.rowsource = activesheet.range("a1:a2") end sub
i type mismatch error. please shine light on going on?
userform1.listbox1.rowsource takes string:
use this: userform1.listbox1.rowsource = activesheet.name & "!a1:a2"
Comments
Post a Comment