I want to only do this with VBA as the values are going to be static and never change. I am going to add a listbox and name it listbox1 - I need to use vba to add a NULL value - default selection, and add the values Joe, John. And also in VBA read the selected value from the listbox. pseudocode would be
Code:
'populatelistbox
listbox1.Values = Array(NULL, "Joe", "John")
'read listbox values
if listbox1.Value = NULL Then
MessageBox.Show("You must select a name")
Else
pickedvalue = listbox1.Selection
endif
'process depending
if pickedvalue = "Joe" Then
MessageBox.Show "You Picked Joe"
Else if pickedvalue = "John" Then
MessageBox.Show "You Picked John"
End if