PDA

View Full Version : [SOLVED] Quick question about Listboxes



Warlie
06-30-2016, 12:46 PM
Hello,
I'm sure I'm missing something obvious, but I've searched around and can't find the answer.

I'm working with a Userform, and on it is a listbox. The user submits an amount of entries, say 10. Once that's done, I want to extract a particular entry via VBA and assign it to a variable.

For example, say I want to assign entry number 6 to the variable n...

Pseudocode being:

n = lstListBox1.getvalue(6)

What code should I be using?

Thanks,
Charlie.

mdmackillop
06-30-2016, 01:51 PM
n = lstListBox1.List(5)

Warlie
06-30-2016, 01:58 PM
n = lstListBox1.List(5)

you're a star cheers pal